-
Type: Task
-
Resolution: Duplicate
-
Priority: Critical - P2
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
Hi Team,
We are working on the following case where we need the confirmation of the behaviour.
let's consider the following example,where "test" json object will have keys.
{
"_id": ObjectID('123'),
"test":
},
{
"_id": ObjectID('456'),
"test":
We wanted to filter all the documents where "test" json does have any key other than `"a": 1`.
So, we went to search for the solution and tried the following, which provided the expected result. We also put the index on the "test" field to avoid any performance issues and it worked as well.
db.col.find({"test": {"$gt":
}})
But did not find any such query or case on MongoDB official site, so just looking out for the support that this is a proper solution and there is no downside to it.
Thanks,
- duplicates
-
SERVER-56138 JSON search if any other key present other than given
- Closed