0

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?

Syed
  • 33
  • 2
  • 10

1 Answers1

1

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

magirtopcu
  • 1,194
  • 10
  • 25