<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>Hello,</p>
    <p>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.</p>
    <p>To access part of result, you need to use a json module over
      $mongodb(mgr1=>value).</p>
    <p>Cheers,<br>
      Daniel<br>
    </p>
    <br>
    <div class="moz-cite-prefix">On 21/09/16 14:36, Jonathan Hunter
      wrote:<br>
    </div>
    <blockquote cite="mid:DUB126-W15939CE8AB7AD2AA04641BBDF60@phx.gbl"
      type="cite">
      <style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
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="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla
<a class="moz-txt-link-freetext" href="http://twitter.com/#!/miconda">http://twitter.com/#!/miconda</a> - <a class="moz-txt-link-freetext" href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a>
Kamailio Advanced Training, Berlin, Oct 24-26, 2016 - <a class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a></pre>
  </body>
</html>