Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upsert operation #3215

Closed
fgalan opened this issue Jun 15, 2018 · 1 comment
Closed

Upsert operation #3215

fgalan opened this issue Jun 15, 2018 · 1 comment

Comments

@fgalan
Copy link
Member

fgalan commented Jun 15, 2018

An upsert variant of the entity creation operation should be included using ?options=upsert. For instance:

POST /v2/entities?options=upsert
{
  "id": "E",
  "type": "T",
  "A": {
    "value": 2,
    "type": "Number"
  }
}

will create the entity or update it if already exists.

Note that currently the same can be done using:

POST /v2/op/update
{
  "actionType": "append",
  "entities": [
    {
      "id": "E",
      "type": "T",
      "A": {
        "value": 2,
        "type": "Number"
      }
    }
  ]
}

However it involves more syntactical complexity (i.e. actionType and entities elements) as that operation is designed to a bulk update on entity (and a bulk of 1 is a bit missuse of the operation)

@fgalan fgalan added this to the 1.15.0 milestone Jun 15, 2018
@fgalan
Copy link
Member Author

fgalan commented Jun 15, 2018

Implemented by PR #3217

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant