Why I cannot find the data in Mongodb collection using db.Collection.find?

Viewed 16

I have a database called shop. I have a typo in the field name catagories in one of the collections called products. Hence, I typed db.products.updateMany({},{$rename:{"catagories":"categories"}}). It returned

{
  acknowledged: true,
  insertedId: null,
  matchedCount: 0,
  modifiedCount: 0,
  upsertedCount: 0
}

For matchedCount: 0, I tried to type db.products.find() to see if I can reach my data in the products, and it returns nothing. I am so confused as I have already connected to the db shop. I have also tried so many ways online but still do not work. Can anyone please kindly help me out with what I can do to get to the data in products and change the name of the field from catagories to categories? This is my attempts in VSCode with the connection to MongoDB on the left panel.

0 Answers
Related