<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">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 style="width:100%;font-size:initial;font-family:Calibri,'Slate Pro',sans-serif;color:rgb(31,73,125);text-align:initial;background-color:rgb(255,255,255)">I don't think the 'time' value is valid. If it incorporates whitespace, it needs to be: "new Date()".</div>                                                                                                                                     <div style="width:100%;font-size:initial;font-family:Calibri,'Slate Pro',sans-serif;color:rgb(31,73,125);text-align:initial;background-color:rgb(255,255,255)"><br style="display:initial"></div>                                                                                                                                     <div></div>                                                              <div style="font-size:initial;font-family:Calibri,'Slate Pro',sans-serif;color:rgb(31,73,125);text-align:initial;background-color:rgb(255,255,255)">--<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 width="100%" style="background-color:white;border-spacing:0px"> <tbody><tr><td colspan="2" style="font-size:initial;text-align:initial;background-color:rgb(255,255,255)">                           <div style="border-style:solid none none;border-top-color:rgb(181,196,223);border-top-width:1pt;padding:3pt 0in 0in;font-family:Tahoma,'BB Alpha Sans','Slate Pro';font-size:10pt">  <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><div style="border-style:solid none none;border-top-color:rgb(186,188,209);border-top-width:1pt;font-size:initial;text-align:initial;background-color:rgb(255,255,255)"></div><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">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>