-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
None
-
Affects Version/s: 2.4.1
-
Component/s: Querying
-
None
-
Environment:telman@telman:~$ uname -a
Linux telman 3.5.0-25-generic #39-Ubuntu SMP Mon Feb 25 18:26:58 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
telman@telman:~$ mongo --version
MongoDB shell version: 2.4.1
telman@telman:~$
-
ALL
-
I used the following query at mongo version 2.2.3 as a workaround to provide join.
It worked perfectly.
but since 2.4.1 the following query give an error message :
JavaScript execution failed: ReferenceError: db is not defined near 'result = db.dataBankOrganizationStatus.c' (line 3)
I catched the above error msg on Java Driver aplication side.
so now I have developed new function for the same puporse (query_two) that calculate and return the query bson object.
is the above mentioned message an expected behavior for the 2.4.1 and next mongo versions or it is really an error?
Thanks in advance
regards,
Telman
query_one = { "forms": "period", "$where":function(){ var periodID = this._id; var result = db.dataBankOrganizationStatus.count({ "status.code": { "$in": ["000", "001","002"] }, "workflowStatus.code": { "$in": ["000", "001","002", "003","006",] }, "period": periodID, //this is join "member": ObjectId("projectSpaceLoggedUserId") }); return result > 0; } }
query_two=function(searchObject){ member = searchObject.member; if(member==null){ throw "member coul not be found"; } periods = []; db.dataBankOrganizationStatus.find({ "status.code": { "#in": ["000", "001","002"] }, "workflowStatus.code": { "#in": ["000", "001","002", "003","006",] }, "member": member },{ period:1 }).forEach(function(v){ periods.push(v.period); }) return { forms:"common", _id:{ "#in":periods } } }
- is related to
-
SERVER-8104 MapReduce on Sharded System Can Bypass Auth Checks
- Closed