| Type | Command | Use Case |
|---|---|---|
| Single-field | create_index("users", "email") | Fast equality and range lookups |
| Unique | create_unique_index("users", "email") | Enforce uniqueness |
| Composite | create_composite_index("users", ["dept", "age"]) | Multi-field queries, compound sort |
| Text | create_text_index("articles", ["title", "body"]) | Full-text search |
| Vector | create_vector_index("items", "embedding", 384, "cosine") | Similarity search |
count() returns the index set size without touching documents. Up to 446x faster than scanning.find_one and delete_one stop after the first match.