Home > Net >  Does $pull operator in Mongodb will not raise error if we try to remove a non-existing element in an
Does $pull operator in Mongodb will not raise error if we try to remove a non-existing element in an

Time:12-24

Does $pull operator raise an error when we try to pull an element which doesn't exist in the array in Mongodb?

If it does how to tackle it?

Am not sure about it should work or not

CodePudding user response:

No, it will not raise an error. Your data will stay as it is.

Also, you can easily test things like this. Check this playground with working example.

  • Related