@@ -638,7 +638,14 @@ def upsert_one(self, write_concern=None, read_concern=None, **update):
638638 document = self ._document .objects .with_id (atomic_update .upserted_id )
639639 return document
640640
641- def update_one (self , upsert = False , write_concern = None , full_result = False , ** update ):
641+ def update_one (
642+ self ,
643+ upsert = False ,
644+ write_concern = None ,
645+ full_result = False ,
646+ array_filters = None ,
647+ ** update ,
648+ ):
642649 """Perform an atomic update on the fields of the first document
643650 matched by the query.
644651
@@ -651,6 +658,7 @@ def update_one(self, upsert=False, write_concern=None, full_result=False, **upda
651658 will force an fsync on the primary server.
652659 :param full_result: Return the associated ``pymongo.UpdateResult`` rather than just the number
653660 updated items
661+ :param array_filters: A list of filters specifying which array elements an update should apply.
654662 :param update: Django-style update keyword arguments
655663 full_result
656664 :returns the number of updated documents (unless ``full_result`` is True)
@@ -660,11 +668,18 @@ def update_one(self, upsert=False, write_concern=None, full_result=False, **upda
660668 multi = False ,
661669 write_concern = write_concern ,
662670 full_result = full_result ,
671+ array_filters = array_filters ,
663672 ** update ,
664673 )
665674
666675 def modify (
667- self , upsert = False , full_response = False , remove = False , new = False , ** update
676+ self ,
677+ upsert = False ,
678+ full_response = False ,
679+ remove = False ,
680+ new = False ,
681+ array_filters = None ,
682+ ** update ,
668683 ):
669684 """Update and return the updated document.
670685
@@ -684,6 +699,7 @@ def modify(
684699 :param remove: remove rather than updating (default ``False``)
685700 :param new: return updated rather than original document
686701 (default ``False``)
702+ :param array_filters: A list of filters specifying which array elements an update should apply.
687703 :param update: Django-style update keyword arguments
688704 """
689705
@@ -722,6 +738,7 @@ def modify(
722738 sort = sort ,
723739 return_document = return_doc ,
724740 session = _get_session (),
741+ array_filters = array_filters ,
725742 ** self ._cursor_args ,
726743 )
727744 except pymongo .errors .DuplicateKeyError as err :
0 commit comments