[SERVER-248] DBRefs - "invalid $operator: $id", sometimes. Created: 20/Aug/09  Updated: 10/Sep/09  Resolved: 20/Aug/09

Status: Closed
Project: Core Server
Component/s: Index Maintenance, Shell, Usability
Affects Version/s: 0.9.9
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Phillip Oldham Assignee: Eliot Horowitz (Inactive)
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Description   

> use test
switched to db test
> db.main.find()
{"_id" : "b45c046c-c502-11dd-b0b6-001d7dc91168" , "_ref" : {"$ref" : "test" , "$id" : "b44ab2b6-c502-11dd-b0b6-001d7dc91168"}}
> db.main.find({"_ref":

{'$id' : "b44ab2b6-c502-11dd-b0b6-001d7dc91168", '$ref': 'test'}

})
error:

{"$err" : "invalid $operator: $id"}

> db.main.find({"_ref":

{"$ref" : "test" , "$id" : "b44ab2b6-c502-11dd-b0b6-001d7dc91168"}

})
{"_id" : "b45c046c-c502-11dd-b0b6-001d7dc91168" , "_ref" : {"$ref" : "test" , "$id" : "b44ab2b6-c502-11dd-b0b6-001d7dc91168"}}

Since objects/dictionaries/associative arrays are unordered, one would expect the first example to work.



 Comments   
Comment by Eliot Horowitz (Inactive) [ 10/Sep/09 ]

closed b/c resolved more than 2 week ago

Comment by Eliot Horowitz (Inactive) [ 20/Aug/09 ]

bson objects and json objects are in fact ordered, and the drivers are all cognisant of this.
so $ref has to be first

Generated at Thu Feb 08 02:53:31 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.