<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p><tt>Hi Jayesh,</tt></p>
<p><tt>I completely missed this idea during the module upgrade to
libmongoc 1.6. I don't immediately see a way we can make this
work without some development so that ObjectId() is somehow
tolerated within a JSON (maybe some JSON library parsing flag?
hopefully!). I've opened up an issue for this [1] - let's move
the discussion over there.</tt></p>
<p><tt>Best regards,</tt></p>
<p><tt>[1]: <a class="moz-txt-link-freetext" href="https://github.com/OpenSIPS/opensips/issues/1229">https://github.com/OpenSIPS/opensips/issues/1229</a></tt><br>
</p>
<pre class="moz-signature" cols="72">Liviu Chircu
OpenSIPS Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
<div class="moz-cite-prefix">On 01.12.2017 14:21, Jayesh Nambiar
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CANAYoztezM5r4q0x-xrKXhHevtpdR3h4r13hHo+U-LOiubSPrQ@mail.gmail.com">
<div dir="ltr">Hi All,
<div>I've been playing around with executing raw mongodb queries
with opensips 2.3.2. Though I can run and execute queries
successfully I cannot figure how to write a query that queries
the objectId in mongodb directly.</div>
<div>The raw query basically is:</div>
<div>
<p class="gmail-p1"><span class="gmail-s1">db.runCommand({
find: "customers", filter: {
"_id":ObjectId("5a212d183f1e5e1c7b11b194") } });</span></p>
<p class="gmail-p1"><span class="gmail-s1">But When i write it
in the script as:</span></p>
<p class="gmail-p1"><span class="gmail-s1">cache_raw_query("mongodb:instance1",
"{ \"find\": \"customers\", \"filter\": { \"_id\":
ObjectId(\"5a212d183f1e5e1c7b11b194\") }}","$avp(out)");<br>
</span></p>
<p class="gmail-p1"><span class="gmail-s1">opensips gives json
parsing error. It basically expects the entire ObjectId
string to be in inverted commas to be a valid json. Any
ideas on how to successfully write the above working query
in opensips to pass as a raw query.</span></p>
<p class="gmail-p1">Thanks,</p>
<p class="gmail-p1">- Jayesh<br>
</p>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
</body>
</html>