Firestore Pydantic ODM ships threeDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/santosdevco/firestore-pydantic-odm/llms.txt
Use this file to discover all available pages before exploring further.
str-based enums that act as the vocabulary for batch writes, query filters, and result ordering. Because every member inherits from str, enum values can be passed directly wherever Firestore’s Python client expects a plain string — no extra conversion step needed.
BatchOperation
BatchOperation identifies the kind of atomic write to perform when you pass a list of operations to batch_write(). Each operation is expressed as a two-element tuple: (BatchOperation, model_instance).
| Member | Value |
|---|---|
CREATE | "create" |
UPDATE | "update" |
DELETE | "delete" |
When using
BatchOperation.CREATE, the id field on the model instance may be None. The batch writer will auto-assign a Firestore document ID and write it back to model_instance.id before committing. For UPDATE and DELETE, id must already be set.FirestoreOperators
FirestoreOperators enumerates every comparison and membership operator supported by Firestore queries. You typically encounter these indirectly — the FirestoreField descriptor produces them automatically when you use Python’s built-in comparison syntax. However, you can also reference them directly when constructing raw filter tuples.
| Member | Value | Meaning |
|---|---|---|
LT | "<" | Less than |
LTE | "<=" | Less than or equal |
EQ | "==" | Equal |
NE | "!=" | Not equal |
GT | ">" | Greater than |
GTE | ">=" | Greater than or equal |
IN | "in" | Value is in list |
NOT_IN | "not-in" | Value is not in list |
ARRAY_CONTAINS | "array_contains" | Array field contains value |
ARRAY_CONTAINS_ANY | "array_contains_any" | Array field contains any of the listed values |
- Indirect usage (recommended)
- Direct usage
OrderByDirection
OrderByDirection specifies whether results should be returned in ascending or descending order when an order_by parameter is supplied to find(), find_one(), or their collection-group equivalents.
| Member | Value |
|---|---|
ASCENDING | "ASCENDING" |
DESCENDING | "DESCENDING" |
OrderByDirection overrides __str__ to return the raw value, so it integrates cleanly with the Firestore Python client’s direction keyword argument without any manual coercion.
When an
order_by entry is a bare field rather than a tuple — for example, just User.name — Firestore applies its default ascending order. Wrap the field in a tuple with OrderByDirection.ASCENDING if you want to be explicit.