Data Store Update Rules and Limits

Update objects specify changes to top-level properties in stored documents. Follow the rules and limits in this topic when constructing an update object. For syntax, see Data Store Update Object.

For more information about update object rules and limits, see the following sections:

Update Object Rules

When constructing an update object, follow these rules for operators, property names, and values:

  • Provide at least one update operation. The update object must contain at least one supported operator. Each operator's value must be an object containing at least one document property.

  • Target each property once. Each document property can be targeted by only one update operator.

  • Update top-level properties. Updates can't target the top-level _id property.

  • Use supported property names. Property names must contain at least one character. They can't contain dots, start with $, or be __proto__, constructor, or prototype. The same rules apply to property names in nested values supplied in the update.

  • Use supported values. Accepted values depend on the update operator. Updates can't contain JavaScript functions as values, including within nested objects or arrays. For the values accepted by each operator, see Data Store Update Operators.

If an update fails because of an invalid increment target, an out-of-range numeric result, or an oversized resulting document, the entire update is rolled back. For details about rollback and retries, see dataStore.Collection.

Update Object Limits

The following table lists the limits for update inputs and resulting documents.

Related Topics

General Notices