Skip to main content

DB.UPSERT

POST 

To update one or multiple documents if existed, otherwise insert new documents

Request

Body

    action stringrequired

    Default value: db.upsert

    The action name

    collection stringrequired

    The collection name

    matches objectrequired

    The matches criteria

    update objectrequired

    The data to update with, when matches found

    insert objectrequired

    the data to insert, when matches not found

Responses

Mutation response

Schema
    data object[]

    Array of documents mutated

Loading...