forked from adjoeio/djoemo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate_expression.go
More file actions
23 lines (16 loc) · 879 Bytes
/
update_expression.go
File metadata and controls
23 lines (16 loc) · 879 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package djoemo
type UpdateExpression string
// Set changes path to the given value.
const Set UpdateExpression = "Set"
// SetSet changes a set at the given path to the given value.
const SetSet UpdateExpression = "SetSet"
// SetIfNotExists changes path to the given value, if it does not already exist.
const SetIfNotExists UpdateExpression = "SetIfNotExists"
// SetExpr performs a custom set expression, substituting the args into expr as in filter expressions.
const SetExpr UpdateExpression = "SetExpr"
// Add increments the path value in case of a number, or in case of a set it appends to that set.
// If a prior value doesn't exist it will set the path to that value.
const Add UpdateExpression = "ADD"
// UpdateExpressions is a type alias used for specifiyng multiple
// update expressions at once
type UpdateExpressions map[UpdateExpression]map[string]interface{}