Zvec Logo

Collection Options

The CollectionOption lets you control runtime behavior when creating or opening a collection:

  • read_only: Opens the collection in read-only mode. Attempts to write will raise an error.

    Note: read_only must be set to False when calling create_and_open(), since creation requires writing files to disk.

  • enable_mmap: Uses memory-mapped I/O for faster access (default to True). This trades slightly higher memory cache usage for improved performance.
Collection option
import zvec

collection_option = zvec.CollectionOption(read_only=False, enable_mmap=True)