Hi Guys,
I am using the ndb_mongodb module, and Im just trying to return values from the 
dispatcher table, in particular the setid of a particular entry depending on 
its attrs value.
If I query using mongodb shell command it works fine, here I enter test.com and 
it returns only the setid value, or 2;
db.dispatcher.find( { attrs: "test.com" }, { setid: 1, _id: 0 } ){ "setid" : 2 }

However I have been having issues getting this to work using mongodb_find_one, 
as I would of thought the following route return the same;
if(mongodb_find_one("ml-mongodb", "kamailiosbc", "dispatcher", "{ \"attrs\" : 
\"test.com\" },{ \"setid\": \"1\", \"_id\": \"0\" }", "mgr1"))
However it returns all the entries relating to that attrs columm from 
dispatcher table, instead of just setid.
Is it possible to do this? I  am stuggling to find the json format to acheive 
the same thing.
Also in terms of the mgr1 response, I see its contained within the  
$mongodb(key), can I drill down to get specific fields from it or would I need 
to use transformations or jansson to do this?
Many thanks
Jon                                       
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

Reply via email to