@@ -634,7 +634,7 @@ def upsert_one(self, write_concern=None, read_concern=None, **update):
634
634
document = self ._document .objects .with_id (atomic_update .upserted_id )
635
635
return document
636
636
637
- def update_one (self , upsert = False , write_concern = None , full_result = False , ** update ):
637
+ def update_one (self , upsert = False , write_concern = None , full_result = False , array_filters = None , ** update ):
638
638
"""Perform an atomic update on the fields of the first document
639
639
matched by the query.
640
640
@@ -647,6 +647,7 @@ def update_one(self, upsert=False, write_concern=None, full_result=False, **upda
647
647
will force an fsync on the primary server.
648
648
:param full_result: Return the associated ``pymongo.UpdateResult`` rather than just the number
649
649
updated items
650
+ :param array_filters: A list of filters specifying which array elements an update should apply.
650
651
:param update: Django-style update keyword arguments
651
652
full_result
652
653
:returns the number of updated documents (unless ``full_result`` is True)
@@ -656,11 +657,14 @@ def update_one(self, upsert=False, write_concern=None, full_result=False, **upda
656
657
multi = False ,
657
658
write_concern = write_concern ,
658
659
full_result = full_result ,
660
+ array_filters = array_filters ,
659
661
** update ,
660
662
)
661
663
662
664
def modify (
663
- self , upsert = False , full_response = False , remove = False , new = False , ** update
665
+ self , upsert = False , full_response = False , remove = False , new = False ,
666
+ array_filters = None ,
667
+ ** update
664
668
):
665
669
"""Update and return the updated document.
666
670
@@ -680,6 +684,7 @@ def modify(
680
684
:param remove: remove rather than updating (default ``False``)
681
685
:param new: return updated rather than original document
682
686
(default ``False``)
687
+ :param array_filters: A list of filters specifying which array elements an update should apply.
683
688
:param update: Django-style update keyword arguments
684
689
"""
685
690
@@ -717,6 +722,7 @@ def modify(
717
722
upsert = upsert ,
718
723
sort = sort ,
719
724
return_document = return_doc ,
725
+ array_filters = array_filters ,
720
726
** self ._cursor_args ,
721
727
)
722
728
except pymongo .errors .DuplicateKeyError as err :
0 commit comments