Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 0 additions & 50 deletions modules/ROOT/pages/mutations/update.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -398,56 +398,6 @@ a|
|===
====

=== Mixing `_PUSH` and `_POP`

It is possible to perform both a `_PUSH` and `_POP` operation in one single `update` mutation.

Consider the following type definitions:

[source, graphql, indent=0]
----
type Movie {
title: String
tags: [String]
moreTags: [String]
}
----

You can update both property arrays with either `_PUSH` or `_POP` operators at once:

.Mutation with both a `_PUSH` and a `_POP`
====
[source, graphql, indent=0]
----
mutation {
updateMovies (update: { tags_POP: 1, moreTags_PUSH: "a different tag" }) {
movies {
title
tags
moreTags
}
}
}
----
[col=1,1]
|===
| Before | After
a|
```
tags: ['some tag']
moreTags: []
```
a|
```
tags: []
moreTags ['a different tag']
```
|===
====

== Mathematical operators

You can use mathematical operators to update numerical fields based on their original values in a single DB transaction.
Expand Down
Loading