<HTML><HEAD>
<META content="text/html; charset=ISO-8859-1" http-equiv=Content-Type></HEAD>
<BODY dir=ltr bgColor=#ffffff text=#000000>
<DIV dir=ltr>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: 'Calibri'; COLOR: #000000">
<DIV>Thank you, I have it working. To complete the process though, I also needed
to create a bubble sort in the script to sort the Json keys on the last_modified
field.</DIV>
<DIV> </DIV>
<DIV>I’d like to make a feature request for a sort facility in the raw
query. </DIV>
<DIV
style="FONT-SIZE: small; FONT-FAMILY: 'Calibri'; FONT-WEIGHT: normal; COLOR: #000000; FONT-STYLE: normal; TEXT-DECORATION: none; DISPLAY: inline">
<DIV style="FONT: 10pt tahoma">
<DIV> </DIV>
<DIV style="BACKGROUND: #f5f5f5">
<DIV style="font-color: black"><B>From:</B> <A title=vladpaiu@opensips.org
href="mailto:vladpaiu@opensips.org">Vlad Paiu</A> </DIV>
<DIV><B>Sent:</B> Tuesday, February 10, 2015 4:54 AM</DIV>
<DIV><B>To:</B> <A title=sevpal@aol.com href="mailto:sevpal@aol.com">sevpal</A>
; <A title=users@lists.opensips.org
href="mailto:users@lists.opensips.org">OpenSIPS users mailling list</A> ; <A
title=bogdan@opensips.org href="mailto:bogdan@opensips.org">Bogdan-Andrei
Iancu</A> </DIV>
<DIV><B>Subject:</B> Re: [OpenSIPS-Users] Last Modified AOR for
User</DIV></DIV></DIV>
<DIV> </DIV></DIV>
<DIV
style="FONT-SIZE: small; FONT-FAMILY: 'Calibri'; FONT-WEIGHT: normal; COLOR: #000000; FONT-STYLE: normal; TEXT-DECORATION: none; DISPLAY: inline">
<DIV class=moz-cite-prefix>Hello,<BR><BR>Indeed, date fields where not properly
supported in the cachedb_mongodb module.<BR>I've just committed a fix for this -
so please update your GIT sources to the latest ones.<BR><BR>I've just tested
this with a small script like
:<BR><BR>
if
(!save("location"))<BR>
sl_reply_error();<BR><BR>
sleep("1");<BR><BR>
cache_raw_query("mongodb:instance1","{ \"op\" : \"find\", \"ns\" :
\"location.location\", \"query\": {\"username\" : \"vlad\"}
}","$avp(mongo_result)");
<BR>
$json(json_res) :=
$avp(mongo_result);<BR>
$avp(expiration) =
$json(json_res/expires)-$Ts;<BR>
$avp(last_edited) =
$Ts-$json(json_res/last_modified);<BR>
xlog("Username vlad will expired in $avp(expiration) seconds and was edited
$avp(last_edited) seconds ago \n"); <BR><BR>Best Regards,<BR><PRE class=moz-signature cols="72">Vlad Paiu
OpenSIPS Developer
<A class=moz-txt-link-freetext href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</A> </PRE>On
10.02.2015 04:26, sevpal wrote:<BR></DIV>
<BLOCKQUOTE cite=mid:D22FB6FA163E4592B9FCCA458675D05E@LenovoPC type="cite">
<DIV dir=ltr>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: 'Calibri'; COLOR: #000000">
<DIV>The data in the DB are stored correctly, there aren’t any problems there,
I can view all the fields properly set with “db.location.find()” . On a raw
Query though, all the other fields return with Json data except the date/time
fields. It seems mongo needs a different kind of directive than what is
currently in the module to retrieve the data.</DIV>
<DIV
style="FONT-SIZE: small; FONT-FAMILY: 'Calibri'; FONT-WEIGHT: normal; COLOR: #000000; FONT-STYLE: normal; TEXT-DECORATION: none; DISPLAY: inline">
<DIV style="FONT: 10pt tahoma">
<DIV> </DIV>
<DIV style="BACKGROUND: #f5f5f5">
<DIV style="font-color: black"><B>From:</B> <A title=bogdan@opensips.org
href="mailto:bogdan@opensips.org" moz-do-not-send="true">Bogdan-Andrei
Iancu</A> </DIV>
<DIV><B>Sent:</B> Monday, February 09, 2015 4:24 AM</DIV>
<DIV><B>To:</B> <A title=sevpal@aol.com href="mailto:sevpal@aol.com"
moz-do-not-send="true">sevpal</A> ; <A title=users@lists.opensips.org
href="mailto:users@lists.opensips.org" moz-do-not-send="true">OpenSIPS users
mailling list</A> </DIV>
<DIV><B>Subject:</B> Re: [OpenSIPS-Users] Last Modified AOR for
User</DIV></DIV></DIV>
<DIV> </DIV></DIV>
<DIV
style="FONT-SIZE: small; FONT-FAMILY: 'Calibri'; FONT-WEIGHT: normal; COLOR: #000000; FONT-STYLE: normal; TEXT-DECORATION: none; DISPLAY: inline">
<DIV class=moz-cite-prefix><TT>Hi Jalung,<BR><BR>If you list the records in
mongoDB collection, do you see the "last_modified" field properly set ? (I'm
trying to understand if you have a problem with the data in DB or with the
query itself)<BR><BR>Regards,<BR></TT><PRE class=moz-signature cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<A class=moz-txt-link-freetext href="http://www.opensips-solutions.com" moz-do-not-send="true">http://www.opensips-solutions.com</A></PRE>On
07.02.2015 01:47, sevpal wrote:<BR></DIV>
<BLOCKQUOTE cite=mid:1F168A0E50D944B38A363F687AD6A7E6@LenovoPC type="cite">
<DIV dir=ltr>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: 'Calibri'; COLOR: #000000">
<DIV>If I’m storing the location table in a mongodb collection, how to query
the most current AOR for a user? I can query all the fields except the
date/time fields eg; “last_modified”, they return empty. I’m doing this
using the mongo raw query in Opensips.</DIV>
<DIV> </DIV>
<DIV>Jalung </DIV></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" moz-do-not-send="true">Users@lists.opensips.org</A>
<A class=moz-txt-link-freetext href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" moz-do-not-send="true">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</A>
</PRE></BLOCKQUOTE><BR></DIV></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></DIV></DIV></DIV></BODY></HTML>