Details
-
New Feature
-
Resolution: Won't Fix
-
Major - P3
-
None
-
None
-
None
Description
When querying with dot notation mongodb returns the full path of the object.
Most of the times the desired behavior is to get only the final key.
This feature can be configured with 'shortPath: true' or 'lastKey: true'.
Let's consider the following doc:
db.session.save({"userid":"5", "key1": {"key2": "val2"}});
and a dot notation query:
db.session.find(
,
{"key1.key2":1});
result:
[{
"_id" : ObjectId("4bb72974f9054d050a00489f"),
"key1" :
}]
I suggest that the result will be:
[{
"_id" : ObjectId("4bb72974f9054d050a00489f"),
"key2" : "val2"
}]
Thanks