<div dir="ltr">this is spot on daniel, thanks!</div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature">Kelvin Chua</div></div>
<br><div class="gmail_quote">On Mon, Jun 29, 2015 at 6:18 PM, Daniel-Constantin Mierla <span dir="ltr"><<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    iirc, the command function can execute any type of operation,
    including insert, try with the command like in the next docs:<br>
    <br>
      -
    <a href="http://docs.mongodb.org/manual/reference/command/insert/#dbcmd.insert" target="_blank">http://docs.mongodb.org/manual/reference/command/insert/#dbcmd.insert</a><br>
    <br>
    Cheers,<br>
    Daniel<div><div class="h5"><br>
    <br>
    <div>On 29/06/15 11:33, Kelvin Chua wrote:<br>
    </div>
    <blockquote type="cite">
      <div dir="ltr">according to that documentation, inserting a
        document uses
        <div><br>
        </div>
        <div>mongoc_collection_insert (collection, MONGOC_INSERT_NONE,
          doc, NULL, &error)<br>
        </div>
        <div><br>
        </div>
        <div>which I cannot find in ndb_mongodb.</div>
        <div><br>
        </div>
        <div>is this really supported? or should be added to the module?</div>
      </div>
      <div class="gmail_extra"><br clear="all">
        <div>
          <div>Kelvin Chua</div>
        </div>
        <br>
        <div class="gmail_quote">On Mon, Jun 29, 2015 at 3:40 PM,
          Daniel-Constantin Mierla <span dir="ltr"><<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>></span> wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div bgcolor="#FFFFFF" text="#000000"> Hello,<br>
              <br>
              the exported functions are wrapper around the MongoDB C
              API, so the commands should work like described in the
              API, see:<br>
              <br>
              <a href="http://api.mongodb.org/c/current/index.html" target="_blank">http://api.mongodb.org/c/current/index.html</a><br>
              <br>
              Cheers,<br>
              Daniel
              <div>
                <div><br>
                  <br>
                  <div>On 27/06/15 16:46, Kelvin Chua wrote:<br>
                  </div>
                  <blockquote type="cite">
                    <p dir="ltr">quoting it would tell mongo that it is
                      a string, not a function. just like quoting now()
                      in mysql.</p>
                    <p dir="ltr">for the sake of completeness, i tried
                      it as well but it fails with the same error
                      message. the whole insert command works on mongo's
                      console so i know it is correct.</p>
                    <p dir="ltr">my guess is there is some quirks with
                      the way it handles the syntax just like nodejs'
                      issues with the syntax. it's not something you can
                      copy and paste to mongo's console. but the
                      question is, where is the documentation on it?<br>
                      on nodejs, it is very clear on the docmentation
                      that there might be some extra parameters before
                      the callbacks.</p>
                    <div class="gmail_quote">On Jun 27, 2015 10:10 PM,
                      "Alex Balashov" <<a href="mailto:abalashov@evaristesys.com" target="_blank">abalashov@evaristesys.com</a>>

                      wrote:<br type="attribution">
                      <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
                        <div style="background-color:rgb(255,255,255);line-height:initial">
                          <div>I don't think the 'time' value is valid.
                            If it incorporates whitespace, it needs to
                            be: "new Date()".</div>
                          <div><br style="display:initial">
                          </div>
                          <div>--<br>
Alex Balashov | Principal | Evariste Systems LLC<br>
                            303 Perimeter Center North, Suite 300<br>
                            Atlanta, GA 30346<br>
                            United States<br>
                            <br>
                            Tel: <a href="tel:%2B1-800-250-5920" value="+18002505920" target="_blank">+1-800-250-5920</a> (toll-free) / <a href="tel:%2B1-678-954-0671" value="+16789540671" target="_blank">+1-678-954-0671</a> (direct)<br>
                            Web: <a href="http://www.evaristesys.com/" target="_blank">http://www.evaristesys.com/</a>, <a href="http://www.csrpswitch.com/" target="_blank">http://www.csrpswitch.com/</a><br>
                            <br>
                            Sent from my BlackBerry.</div>
                          <table style="background-color:white;border-spacing:0px" width="100%">
                            <tbody>
                              <tr>
                                <td colspan="2" style="font-size:initial;text-align:initial;background-color:rgb(255,255,255)">
                                  <div>
                                    <div><b>From: </b>Kelvin Chua</div>
                                    <div><b>Sent: </b>Saturday, June
                                      27, 2015 10:05</div>
                                    <div><b>To: </b>SIP Router -
                                      Kamailio (OpenSER) and SIP Express
                                      Router (SER) - Users Mailing List</div>
                                    <div><b>Reply To: </b>Kamailio
                                      (SER) - Users Mailing List</div>
                                    <div><b>Subject: </b>[SR-Users]
                                      invalid char in json text</div>
                                  </div>
                                </td>
                              </tr>
                            </tbody>
                          </table>
                          <br>
                          <div>
                            <div dir="ltr">Playing around with
                              ndb_mongodb
                              <div><br>
                              </div>
                              <div>getting this error:</div>
                              <div><br>
                              </div>
                              <div>ERROR: ndb_mongodb
                                [mongodb_client.c:262]:
                                mongodbc_exec_cmd(): Failed to run
                                command: lexical error: invalid char in
                                json text<br>
                              </div>
                              <div><br>
                              </div>
                              <div>query is very simple:</div>
                              <div>db.cdrs.insert({time:new
                                Date(),src_user:"kelvin",term_ani:"14112",src_domain:"<a href="http://domain.com" target="_blank">domain.com</a>",src_ip:"0",dst_ouser:"18188",dst_user:"18112",dst_domain:"<a href="http://domain.com" target="_blank">domain.com</a>"})<br>
                              </div>
                              <div><br>
                              </div>
                              <div>which is inside a pv</div>
                              <div>mongodb_cmd("mgs1", "datab", "cdrs",
                                "$var(MNG_MISSED)", "mgr1");<br>
                              </div>
                              <div><br>
                              </div>
                              <div>tried this:</div>
                              <div>insert({time:new
                                Date(),src_user:"kelvin",term_ani:"14112",src_domain:"<a href="http://domain.com" target="_blank">domain.com</a>",src_ip:"0",dst_ouser:"18188",dst_user:"18112",dst_domain:"<a href="http://domain.com" target="_blank">domain.com</a>"})<br>
                              </div>
                              <div><br>
                              </div>
                              <div>and other combinations, same error</div>
                              <div><br>
                              </div>
                              <div>any ideas? i guess we need some more
                                examples on the documentation</div>
                              <div><br>
                              </div>
                              <div><br clear="all">
                                <div>
                                  <div>Kelvin Chua</div>
                                </div>
                              </div>
                            </div>
                            <br>
                          </div>
                        </div>
                        <br>
                        _______________________________________________<br>
                        SIP Express Router (SER) and Kamailio (OpenSER)
                        - sr-users mailing list<br>
                        <a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a><br>
                        <a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
                        <br>
                      </blockquote>
                    </div>
                    <br>
                    <fieldset></fieldset>
                    <br>
                    <pre>_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a>
<a 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>
                </div>
              </div>
              <span><font color="#888888">
                  <pre cols="72">-- 
Daniel-Constantin Mierla
<a href="http://twitter.com/#%21/miconda" target="_blank">http://twitter.com/#!/miconda</a> - <a href="http://www.linkedin.com/in/miconda" target="_blank">http://www.linkedin.com/in/miconda</a>
Book: SIP Routing With Kamailio - <a href="http://www.asipto.com" target="_blank">http://www.asipto.com</a></pre>
                </font></span></div>
            <br>
            _______________________________________________<br>
            SIP Express Router (SER) and Kamailio (OpenSER) - sr-users
            mailing list<br>
            <a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a><br>
            <a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
            <br>
          </blockquote>
        </div>
        <br>
      </div>
    </blockquote>
    <br>
    <pre cols="72">-- 
Daniel-Constantin Mierla
<a href="http://twitter.com/#!/miconda" target="_blank">http://twitter.com/#!/miconda</a> - <a href="http://www.linkedin.com/in/miconda" target="_blank">http://www.linkedin.com/in/miconda</a>
Book: SIP Routing With Kamailio - <a href="http://www.asipto.com" target="_blank">http://www.asipto.com</a></pre>
  </div></div></div>

</blockquote></div><br></div>