Function signature
create_and_open.
Parameters
Path or name of the existing collection.Must point to a valid collection that was previously created with
zvec.create_and_open().Configuration options for opening the collection.Defaults to a default-constructed
CollectionOption() if not provided.Return value
Returns aCollection instance that can be used for querying, inserting, updating, and deleting data.
Exceptions
- May raise errors if the collection does not exist at the specified path.
- May raise errors if the collection is corrupted or incompatible with the current Zvec version.
- May raise errors if the collection is already open by another process (depending on locking behavior).
Examples
Open an existing collection
Simple usage with default options:Open with custom options
Specify collection options when opening:Error handling
Handle potential errors when opening a collection:Open multiple collections
Work with multiple collections simultaneously:Best practices
The same collection can be opened multiple times within the same process, but be aware of potential concurrency issues when writing to the collection.
See also
- zvec.create_and_open - Create a new collection
- zvec.init - Initialize Zvec configuration