System Flags
The API will automatically calculate some properties after updating or inserting a document. These properties are always prefixed with an underscore (_), and cannot be added to the collection's schema for manual manipulation.
Property | Type | Description |
---|---|---|
_id | ObjectId | ID generated by MongoDB (not the API). Every document will have an ID unique to that collection, but not strictly unique in that database. |
_hash | String | Calculated SHA1 hash of the object, generated by the API before changes are commited. System flags are not included. |
_createdAt | DateTime | The Date/Time the document was originally inserted. |
_updatedAt | DateTime | The Date/Time the document was last modified by the API. |
_changedBy | ObjectId | ID of the principal that last modified the document via the API |
Hash
The _hash
property serves as a concurrency token for the API.
Unlike the other system flags, _hash
must be included in the request object when updating or replacing a document.
The API will compare the uploaded hash with the one stored in the database.
If it's different, the document must have been changed by another user or integration since this user or integration started the request.
System flags (except _id
) are calculated by the API during data manipulations.
If a document is modified by a server-side script, using the direct database connection,
the system flags will not be automatically updated.