-
Type:
Improvement
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Querying
-
None
-
Query Optimization
-
0
-
None
-
3
-
None
-
None
-
None
-
None
-
None
-
None
It isn't possible to insert a document with a $ref key at the top-level, so there's no way for the query to ever match anything.
> db.mycoll.insert({$ref: 'mycoll', $id: 1}) WriteResult({ "nInserted" : 0, "writeError" : { "code" : 2, "errmsg" : "Document can't have $ prefixed field names: $ref" } })