'MongoDB Shell deleteMany() function is not working
I have to delete all the data called owner.login. It means in json data, there are one more Object called owner.
So I tried in MongoSH Beta(MongoDB Compasss) and Mongo Shell with this query but it returns this message and it doesn't removed.
{ acknowledged: 1, deletedCount: 0 }
The json data structure looks like this
So I have to delete all the data that owner.login called 'mojombo'.
So I use this query db.repos.deleteMany({owner.login:'mojombo'});
I don't know why the function doesn't work. This command worked well in the Filter function of MongoDB Compass.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|