Back to Chroma

Test Get Collection By Id

examples/basic_functionality/test_get_collection_by_id.ipynb

1.5.9414 B
Original Source
python
import os

current_dir = os.getcwd()
os.chdir("../../")
python

import chromadb

client = chromadb.PersistentClient()

col = client.get_or_create_collection('test_collection')
print(col)


col1=client.get_collection(id=col.id)

print(col1.tenant)
assert col1.id == col.id

assert col1.tenant == col.tenant
assert col1.name == col.name
assert col1.database == col.database
print(col1.database)