Dont set empty strings
parent
71b1de33ec
commit
b28bc74f8b
|
|
@ -296,7 +296,7 @@ func applyUnset(doc, operator bson.M) (bson.M, error) {
|
|||
return nil, err
|
||||
}
|
||||
operator[k] = subdoc
|
||||
} else {
|
||||
} else if len(k) > 0 {
|
||||
delete(doc, k)
|
||||
}
|
||||
}
|
||||
|
|
@ -329,7 +329,7 @@ func applySet(doc, operator bson.M) (bson.M, error) {
|
|||
return nil, err
|
||||
}
|
||||
doc[nesting[0]] = subdoc
|
||||
} else {
|
||||
} else if len(k) > 0 {
|
||||
doc[k] = v
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -77,8 +77,6 @@ func opMarshalable(op, key string, value interface{}) map[string]interface{} {
|
|||
m["$set"].(map[string]interface{})[entity.Modified] = time.Now().UnixNano()
|
||||
case bson.M:
|
||||
m["$set"].(bson.M)[entity.Modified] = time.Now().UnixNano()
|
||||
//case primitive.M:
|
||||
//m["$set"].(primitive.M)[entity.Modified] = time.Now().UnixNano()
|
||||
}
|
||||
return m
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue