How to set mongodb ISODATE record


#1

hi there
i’m looking on a way to set record with the ISODATE parameter in Mongodb
like this
ISODate(“2012-01-12T20:15:31.000+0000”),

i’m running with js SDK, but any input will be welcome

thx


#2

hi,
i finaly change the way to do it
i 've parse my date :
var d =new Date()
var date = Date.parse(d)

and save to mongo on numberlong format

with this, i’m able to do $gt, $get, $lt , $lte on my date

rgd;


#3

hello
Il will again reply to myself

if you want to store Date in ISODATE format with a Setrecord just use:
“date”: { “$date”: “01/01/01” }
and mongoDB wil translate this to : “date” : ISODate(“2001-01-01T00:00:00.000+0000”)

thanks can help a lot for grouping with $day, $year and others

now just need to now how to perform mongodb agregation with dreamfactory