1 Answer
- Newest
- Most votes
- Most comments
0
Amazon DocumentDB does not currently support the ability to use indexes with $elemMatch - reference.
The workaround for your case would be to add an index on {"authors.id":1} and change the update query to:
db.collection.updateMany(
{ "authors.id" : "john"},
{ $pull : { "authors" : { "id" : "john" }}}
);
answered 4 years ago
Relevant content
asked 3 years ago
asked 5 years ago
- AWS OFFICIALUpdated 8 months ago
