Problem in updatinfg documents:insertone()

Hello, I’m having similar issues with this one. When I copy/paste your query I get this in cmd:

{ "acknowledged" : true, "matchedCount" : 0, "modifiedCount" : 0 }

Why is this happening?

I Have Read The Topics ,But Didn’t Find Any Solution…new

Hi @Prasad_35679,

If you look at the output, it says “matchedCount” : 0, which means the search query did not return any document which could be updated.

Can you please verify if you are using the correct database? Just type db in the mongo shell and check what value it prints.

db

If it is not video database then please use the below mentioned command to start using the video database and then execute the update query.

use video

If you still have any other query please feel free to get back to us.

Happy Learning :slight_smile:

Thanks,
Shubham Ranjan
Curriculum Support Engineer

1 Like

Hey @Prasad_35679

What do you get with just the following?

db.movieDetails.find({ title: 'The Martian' }).pretty()
1 Like