1개 답변
- 최신
- 최다 투표
- 가장 많은 댓글
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" }}}
);
답변함 4년 전
