Syed
Syed

Reputation: 33

How can i insert current date in robomongo?

I want to add a date field in mongo db. I am using robo mongo. How can i do that?

If it is a string we can do it by "", if it is a number we can do it by NumberInt. What is the datatype for date field? Also, how can I insert current date?

Upvotes: 0

Views: 2705

Answers (1)

magirtopcu
magirtopcu

Reputation: 1194

db.yourcollection.insert({date_field_name:new Date()})

Upvotes: 1

Related Questions