Re: How to add current date in RobomongoDB

From: Chris Cunningham <chris.cunningham@xxxxxxxxxxx>
To: mongodb-user <mongodb-user@xxxxxxxxxxxxxxxx>
Date: Sun, 1 May 2016 23:41:41 -0700 (PDT)
Why ads?
Nilesh,

Because Robomongo embeds the mongo shell, you should be able to add the 
current date like the following example:

{
    "date" : ISODate("2016-05-26T00:00:00.000Z"),
    "userId" : NumberLong(10),
    "name" : "Green Tea with honey",
    "calss" : "BSC-SE",
    "createdAt" : new ISODate()
}



This works because the MongoDB shell is a JavaScript REPL, so you are able 
to utilize JavaScript constructors to simplify tasks.

Additional information on new ISODate()can be found in the MongoDB 
documentation at:

[Data Types in the mongo Shell 
<https://docs.mongodb.org/manual/core/shell-types/#date>]

Please let us know if you have any further questions.

Regards,

Chris 




On Wednesday, April 27, 2016 at 12:31:14 AM UTC+10, NileshM wrote:

i want to insert exact current date in mongoDB throw robo mongo.
PFA


-- 
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.

For other MongoDB technical support options, see: https://docs.mongodb.org/manual/support/
--- 
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+unsubscribe@xxxxxxxxxxxxxxxx.
To post to this group, send email to mongodb-user@xxxxxxxxxxxxxxxx.
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/aaa5807d-f8fa-4ee8-9ae1-871d9abaf436%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Why ads?