FirebaseExpressSdk, by passing a collections object to the constructor.
Declaring collections
Each key incollections is the exact name of a Firestore collection. Each value is a configuration object that must include documentAttributes.
documentAttributes
documentAttributes is a required array of field name strings. It defines the schema for documents in that collection.
The SDK enforces this schema on all write operations:
| Operation | Enforcement |
|---|---|
POST | All attributes must be present in the request body. |
PUT | All attributes must be present in the request body. |
PATCH | At least one attribute must be present in the request body. |
documentAttributes, the SDK rejects the request with an error response. Extra fields are never silently ignored.
The collection name you use as the key in
collections must match the Firestore collection name exactly, including case. "Users" and "users" are treated as different collections.