If adding to an empty value, set it as an array
If we have an empty field ‘test’ and we specify the sql `SET test += “test”` then we’ll presume it’s going to be an array if it isn’t a number or a decimal.
This commit is contained in:
parent
8849c7c30a
commit
8076afd414
1 changed files with 2 additions and 0 deletions
|
@ -845,6 +845,8 @@ func (d *Doc) Inc(value interface{}, path ...string) (*Doc, error) {
|
||||||
return d.Set(0+inc, path...)
|
return d.Set(0+inc, path...)
|
||||||
case float64:
|
case float64:
|
||||||
return d.Set(0+inc, path...)
|
return d.Set(0+inc, path...)
|
||||||
|
default:
|
||||||
|
return d.Set([]interface{}{value}, path...)
|
||||||
}
|
}
|
||||||
case int64:
|
case int64:
|
||||||
switch inc := value.(type) {
|
switch inc := value.(type) {
|
||||||
|
|
Loading…
Reference in a new issue