Array push

The array_push mutation adds the entered value to an array.

Examples

We will be making some changes to the following company document:

{
  "_meta": {
    "index": "companies",
    "guid": "e6ad61ba9d7e27a12aae81bd7d93d4a347975ff91e8d2c10b00aa7877108deaa",
    "created": 1620227815616,
    "updated": 1620227816609,
    "removed": 0,
    "expiry": 1622819815616,
    "created_by": {
      "host": "myluxura-api",
      "resource": {
        "name": "[email protected]",
        "guid": "785041ee4d640635dad8f0f45c343e912b1c4cb8d4fae18c662f221d4e3dadae",
        "index": "users"
      }
    }
  },
  "name": "Example company",
  "company_type": "owner",
  "location": {
    "place_id": null,
    "description": null
  },
  "tags": ["example"]
}

Adding a tag to this company 's tags array should be done as follows:

The body of this update request should look like:

Last updated

Was this helpful?