> encode({f:[{a:{b:2}}]})
{“f”:[{“a.b”:2}]})
However, sticking that in mongo's update does not give the desired results:
> db.test.update({..}, {$set : {“f”:[{“a.b”:2}]}})
{ “_id” : ObjectId("…"), ... , “f” : [ { “a.b” : 2 } ] }
Essentially, the dot-notation is only relevant in top-level entries. Anything below, mongo treats as the key name directly.
I would think that the correct behavior of encode should be to not recursively apply dot notations into vectors.