@@ -634,7 +634,7 @@ def upsert_one(self, write_concern=None, read_concern=None, **update):
634634 document = self ._document .objects .with_id (atomic_update .upserted_id )
635635 return document
636636
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 ):
638638 """Perform an atomic update on the fields of the first document
639639 matched by the query.
640640
@@ -647,6 +647,7 @@ def update_one(self, upsert=False, write_concern=None, full_result=False, **upda
647647 will force an fsync on the primary server.
648648 :param full_result: Return the associated ``pymongo.UpdateResult`` rather than just the number
649649 updated items
650+ :param array_filters: A list of filters specifying which array elements an update should apply.
650651 :param update: Django-style update keyword arguments
651652 full_result
652653 :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
656657 multi = False ,
657658 write_concern = write_concern ,
658659 full_result = full_result ,
660+ array_filters = array_filters ,
659661 ** update ,
660662 )
661663
662664 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
664668 ):
665669 """Update and return the updated document.
666670
@@ -680,6 +684,7 @@ def modify(
680684 :param remove: remove rather than updating (default ``False``)
681685 :param new: return updated rather than original document
682686 (default ``False``)
687+ :param array_filters: A list of filters specifying which array elements an update should apply.
683688 :param update: Django-style update keyword arguments
684689 """
685690
@@ -717,6 +722,7 @@ def modify(
717722 upsert = upsert ,
718723 sort = sort ,
719724 return_document = return_doc ,
725+ array_filters = array_filters ,
720726 ** self ._cursor_args ,
721727 )
722728 except pymongo .errors .DuplicateKeyError as err :
0 commit comments