Function updateChildById

  • Update a child document using its _id and parent _id.

    This operation allows you to do a partial update of a collection document i.e. without specifying all the values (it uses DynamoDBs UpdateItem` operation).

    At this time, the updates value just updates specified key paths on the target document.

    If some of the update key paths are indexed values, the indexes will also be updated. Because of this, you must specify all the key values in an access pattern to ensure indexes are updated consistently.

    Type Parameters

    Parameters

    • context: Context

      the context

    • collectionName: string

      the collection to update

    • objectId: string

      the _id value of the object to update

    • parentObjectId: string
    • updates: Updates

      the set of updates to apply.

    • options: {
          condition?: CompositeCondition;
      } = {}

      options to apply

      • Optional condition?: CompositeCondition

        an optional conditional expression that must be satifisfied for the update to proceed

    Returns Promise<DocumentType>

    the updated object value in its entirety.

    Throws

    CollectionNotFoundException collection not found

    Throws

    InvalidUpdatesException thrown when the updates object is invalid or incomplete

    Throws

    InvalidUpdateValueException thrown when one of the update values is an invalid type

Generated using TypeDoc