bradtraversy / microposts_fullstack_vue

Full stack vue and express
172 stars 84 forks source link

Update posts.js #19

Open carlosabreuh opened 3 years ago

carlosabreuh commented 3 years ago

_id needs to be in quotes in order for it to work with MongoDB. This is new.

carlosabreuh commented 3 years ago

Old ({ _id : mongodb.ObjectId(req.params.id)})

New ({ "_id" : mongodb.ObjectId(req.params.id)})

bradtraversy commented 2 years ago

I thought they were optional unless there were a dot notation like

db.test.find({"name.first": "Brad"})

Can you direct me to the docs where it says it has changed?

thanks