Document field name rules
A document can contain user-defined and reserved fields.
User-defined field names can be any non-empty sequence of Unicode characters, with the following exceptions:
-
Field names cannot start with
$. -
Field names cannot be exactly
*. -
If a field name includes
&or., you must escape those characters when you use the field in a filter, sort, projection, or update. For more information, see Work with.and&in field names.
Reserved fields are tied to specific functionality. Include the following reserved fields in your documents, if applicable:
-
_id: An optional unique identifier for the document. If_idis omitted, it is created automatically based on the collection’s ID type. For more information, see Document IDs. -
$vector: An optional array of numbers representing a vector embedding for vector search. The$vectorfield is only supported for vector-enabled collections.