-
Type: Bug
-
Resolution: Done
-
Priority: Minor - P4
-
None
-
Affects Version/s: 2.2.1
-
Component/s: Querying
-
None
-
Query
-
ALL
After SERVER-828, it's not possible to specify a field with $ in the field as part of the projection. This is likely an edge case not handled by the Projection::validateQuery() implementation here: https://github.com/mongodb/mongo/commit/fb66c84bc7bc1ece63a65766bfea2f797f3b7121
> db.foo.drop() > db.foo.save({a:{$id: new ObjectId()}}); > db.foo.find({}, {'a.$id': 1}) error: { "$err" : "Positional operator does not match the query specifier.", "code" : 16354 }
The reproduction steps are a bit contrived, but the practical use case is a projection of the $id field of a DBRef object.
- is related to
-
SERVER-828 Support for selecting array elements in return specifier (projection)
- Closed