2

THIS IS NOT A DUPLICATE OF ANOTHER QUESTION< AT LEAST THE WAY I UNDERSTAND IT. I AM NOT TRYING TO GET THE CURRENT TIME, BUT A DIFFERENT TIME (SAY JANUARY 2000)

I know this is probably very simple, but I am just learning. I am adding some document to mongodb. Say for example I have:

db.mytest.insert({
_id: 2,
name: { first_name: 'me', last_name:'you' },
education: [
{ university: 'MyU', city: 'Earth', graduation_date: new Date('January, 2000') }
]
})

This works fine if I do it directly, however when I try to use pymongo to create python code in a web page to add this info into a mongodb, it does not like the new Date.

Is there a way I can use mongodb and keep the same syntax? If not, how do I modify the code?

Thank you!

user
  • 2,015
  • 6
  • 22
  • 39

0 Answers0