impl entities and test

This commit is contained in:
breel
2020-08-09 10:41:37 -06:00
parent 64772166cc
commit 468e5bedd5
4 changed files with 448 additions and 14 deletions

View File

@@ -310,6 +310,14 @@ func applySet(doc, operator bson.M) (bson.M, error) {
if k == entity.ID {
continue
}
if k == "." {
m, ok := v.(bson.M)
if !ok {
return nil, errors.New("cannot assign non-map to doc")
}
doc = m
return doc, nil
}
nesting := strings.Split(k, ".")
if len(nesting) > 1 {
mInterface, ok := doc[nesting[0]]