Skip to content
FermionDB

Docs · API reference

MongoDB API reference.

FermionDB speaks the MongoDB wire protocol, so you use the MongoDB drivers and query language you already know. This page covers connecting, indexing and vector search, and lists what FermionDB supports.

Connect

Point any MongoDB driver at your FermionDB address. Nothing else changes.

from pymongo import MongoClient

client = MongoClient("mongodb://HOST:PORT")
products = client.shop.products

Create the indexes

One vector index per collection, plus a regular index on each field you filter by. Create them before you load documents.

# Regular indexes on the fields you filter by
products.create_index([("in_stock", 1)])
products.create_index([("category", 1)])

# The vector index
client.shop.command({
    "createSearchIndex": "products",
    "name": "products_vec",
    "type": "vectorSearch",
    "definition": {"fields": [{
        "type": "vector", "path": "embedding",
        "numDimensions": 1536, "similarity": "cosine",
    }]},
})

Supported MongoDB API

What FermionDB supports today. Need something that isn't listed? Tell us when you request early access.

Drivers
Any MongoDB driverPyMongoNode.jsGoJavamongosh
Pipeline stages
$vectorSearch$match$project$group$sort$limit
$vectorSearch filter
Equality$in$nin$ne
$match operators
Equality$in$gte$regex
Expressions
$sum$meta: "vectorSearchScore"
Commands
insertManyaggregatecreateIndexcreateSearchIndexlistSearchIndexes
Indexes
Vector (cosine)Single-field