@@ -554,15 +554,9 @@ def _legacy_write(self, sock_info, name, cmd, op_id,
554554
555555 def _insert_one (
556556 self , doc , ordered ,
557- check_keys , manipulate , write_concern , op_id , bypass_doc_val ,
557+ check_keys , write_concern , op_id , bypass_doc_val ,
558558 session ):
559559 """Internal helper for inserting a single document."""
560- if manipulate :
561- doc = self .__database ._apply_incoming_manipulators (doc , self )
562- if not isinstance (doc , RawBSONDocument ) and '_id' not in doc :
563- doc ['_id' ] = ObjectId ()
564- doc = self .__database ._apply_incoming_copying_manipulators (doc ,
565- self )
566560 write_concern = write_concern or self .write_concern
567561 acknowledged = write_concern .acknowledged
568562 command = SON ([('insert' , self .name ),
@@ -646,7 +640,7 @@ def insert_one(self, document, bypass_document_validation=False,
646640 write_concern = self ._write_concern_for (session )
647641 return InsertOneResult (
648642 self ._insert_one (
649- document , ordered = True , check_keys = True , manipulate = False ,
643+ document , ordered = True , check_keys = True ,
650644 write_concern = write_concern , op_id = None ,
651645 bypass_doc_val = bypass_document_validation , session = session ),
652646 write_concern .acknowledged )
@@ -712,14 +706,12 @@ def gen():
712706 return InsertManyResult (inserted_ids , write_concern .acknowledged )
713707
714708 def _update (self , sock_info , criteria , document , upsert = False ,
715- check_keys = True , multi = False , manipulate = False ,
709+ check_keys = True , multi = False ,
716710 write_concern = None , op_id = None , ordered = True ,
717711 bypass_doc_val = False , collation = None , array_filters = None ,
718712 hint = None , session = None , retryable_write = False ):
719713 """Internal update / replace helper."""
720714 common .validate_boolean ("upsert" , upsert )
721- if manipulate :
722- document = self .__database ._fix_incoming (document , self )
723715 collation = validate_collation_or_none (collation )
724716 write_concern = write_concern or self .write_concern
725717 acknowledged = write_concern .acknowledged
@@ -801,15 +793,15 @@ def _update(self, sock_info, criteria, document, upsert=False,
801793
802794 def _update_retryable (
803795 self , criteria , document , upsert = False ,
804- check_keys = True , multi = False , manipulate = False ,
796+ check_keys = True , multi = False ,
805797 write_concern = None , op_id = None , ordered = True ,
806798 bypass_doc_val = False , collation = None , array_filters = None ,
807799 hint = None , session = None ):
808800 """Internal update / replace helper."""
809801 def _update (session , sock_info , retryable_write ):
810802 return self ._update (
811803 sock_info , criteria , document , upsert = upsert ,
812- check_keys = check_keys , multi = multi , manipulate = manipulate ,
804+ check_keys = check_keys , multi = multi ,
813805 write_concern = write_concern , op_id = op_id , ordered = ordered ,
814806 bypass_doc_val = bypass_doc_val , collation = collation ,
815807 array_filters = array_filters , hint = hint , session = session ,
@@ -1346,8 +1338,6 @@ def find(self, *args, **kwargs):
13461338 oplogReplay query flag. Default: False.
13471339 - `batch_size` (optional): Limits the number of documents returned in
13481340 a single batch.
1349- - `manipulate` (optional): **DEPRECATED** - If True, apply any
1350- outgoing SON manipulators before returning. Default: True.
13511341 - `collation` (optional): An instance of
13521342 :class:`~pymongo.collation.Collation`. This option is only supported
13531343 on MongoDB 3.4 and above.
0 commit comments