`Queryset.modify` not support kwarg `array_filters`
ninochang opened this issue · 1 comments
ninochang commented
Starts from 0.28.0 update
, and update_one
starts to support kwarg array_filters
which inline with https://www.mongodb.com/docs/manual/reference/operator/update/positional-filtered/.
Base on mongodb doc link above, Queryset.modify
should also support array_filters
, the underlying pymongo function also supports it.
Current behavior
mongoengine: 0.28.2
User.objects.filter(id='uid').only('id', 'items').modify(
__raw__={'$set': {'items.$[item].done': True}},
array_filters=[{
'$and': [
{'item.id': 'qqq'},
],
}],
)
# InvalidQueryError: Cannot resolve field "array_filters"
The solution should be similar to This PR, handle array_filters
inside modify
function.