Hello,

Indeed, date fields where not properly supported in the cachedb_mongodb module. I've just committed a fix for this - so please update your GIT sources to the latest ones.

I've just tested this with a small script like :

                if (!save("location"))
                        sl_reply_error();

                sleep("1");

cache_raw_query("mongodb:instance1","{ \"op\" : \"find\", \"ns\" : \"location.location\", \"query\": {\"username\" : \"vlad\"} }","$avp(mongo_result)");
                $json(json_res) := $avp(mongo_result);
                $avp(expiration) = $json(json_res/expires)-$Ts;
                $avp(last_edited) = $Ts-$json(json_res/last_modified);
xlog("Username vlad will expired in $avp(expiration) seconds and was edited $avp(last_edited) seconds ago \n");

Best Regards,

Vlad Paiu
OpenSIPS Developer
http://www.opensips-solutions.com

On 10.02.2015 04:26, sevpal wrote:
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.
*From:* Bogdan-Andrei Iancu <mailto:[email protected]>
*Sent:* Monday, February 09, 2015 4:24 AM
*To:* sevpal <mailto:[email protected]> ; OpenSIPS users mailling list <mailto:[email protected]>
*Subject:* Re: [OpenSIPS-Users] Last Modified AOR for User
Hi Jalung,

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)

Regards,
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com
On 07.02.2015 01:47, sevpal wrote:
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.
Jalung


_______________________________________________
Users mailing list
[email protected]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users



_______________________________________________
Users mailing list
[email protected]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

_______________________________________________
Users mailing list
[email protected]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

Reply via email to