W
W
Wasya UK2017-05-08 19:08:42
MongoDB
Wasya UK, 2017-05-08 19:08:42

How to delete array elements in mongodb?

How to remove array element in mongodb? All searches result in a remove method, findAndRemove ... and they all remove the document.
For example, a user has a friends field , and there is an input array , and there are 10 user ids in it. How can I select a user with the desired id and delete it?
Thanks in advance

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
emp1re, 2017-05-08
@dmc1989

https://docs.mongodb.com/manual/reference/operator...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question