<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Hello,<div><br></div><div>Ok cool thanks Daniel will do that.</div><div><br></div><div>Cheers</div><div><br></div><div>Jon<br><br><div><hr id="stopSpelling">To: sr-users@lists.sip-router.org<br>From: miconda@gmail.com<br>Date: Thu, 22 Sep 2016 07:28:19 +0200<br>Subject: Re: [SR-Users] ndb_mongodb -Sending Query to Mongo<br><br>
Hello,<BR>
in case of ndb_mongodb, the result is the json returned by the
server. Maybe you can run with debug=3 and see if you can get more
info about what happens there.<BR>
To access part of result, you need to use a json module over
$mongodb(mgr1=>value).<BR>
Cheers,<br>
Daniel<br>
<BR>
<br>
<div class="ecxmoz-cite-prefix">On 21/09/16 14:36, Jonathan Hunter
wrote:<br>
</div>
<blockquote cite="mid:DUB126-W15939CE8AB7AD2AA04641BBDF60@phx.gbl">
<style><!--
.ExternalClass .ecxhmmessage P {
padding:0px;
}
.ExternalClass body.ecxhmmessage {
font-size:12pt;
font-family:Calibri;
}
--></style>
<div dir="ltr">
<div>Hi Guys,</div>
<div><br>
</div>
<div>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.</div>
<div><br>
</div>
<div>If I query using mongodb shell command it works fine, here
I enter test.com and it returns only the setid value, or 2;</div>
<div><br>
</div>
<div>db.dispatcher.find( { attrs: "test.com" }, { setid: 1, _id:
0 } )</div>
<div>{ "setid" : 2 }</div>
<div><br>
</div>
<div><br>
</div>
<div>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;</div>
<div><br>
</div>
<div>if(mongodb_find_one("ml-mongodb", "kamailiosbc",
"dispatcher", "{ \"attrs\" : \"test.com\" },{ \"setid\":
\"1\", \"_id\": \"0\" }", "mgr1"))</div>
<div><br>
</div>
<div>However it returns all the entries relating to that attrs
columm from dispatcher table, instead of just setid.</div>
<div><br>
</div>
<div>Is it possible to do this? I am stuggling to find the json
format to acheive the same thing.</div>
<div><br>
</div>
<div>Also in terms of the mgr1 response, I see its contained
within the <span style="background-color:rgb(255, 255, 255);font-family:Helvetica, Arial;font-size:12px;text-align:justify;"> </span><span style="background-color:rgb(255, 255, 255);font-family:Helvetica, Arial;font-size:12px;text-align:justify;">$mongodb(key), can I drill down to get
specific fields from it or would I need to use
transformations or jansson to do this?</span></div>
<div><br>
</div>
<div>Many thanks</div>
<div><br>
</div>
<div>Jon</div>
</div>
<br>
<fieldset class="ecxmimeAttachmentHeader"></fieldset>
<br>
<pre>_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a class="ecxmoz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>
<a class="ecxmoz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
</blockquote>
<br>
<pre class="ecxmoz-signature">--
Daniel-Constantin Mierla
<a class="ecxmoz-txt-link-freetext" href="http://twitter.com/#%21/miconda" target="_blank">http://twitter.com/#!/miconda</a> - <a class="ecxmoz-txt-link-freetext" href="http://www.linkedin.com/in/miconda" target="_blank">http://www.linkedin.com/in/miconda</a>
Kamailio Advanced Training, Berlin, Oct 24-26, 2016 - <a class="ecxmoz-txt-link-freetext" href="http://www.asipto.com" target="_blank">http://www.asipto.com</a></pre>
<br>_______________________________________________
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</div></div> </div></body>
</html>