예제 #1
0
 def execute_insert_no_results(self, sock_info, run, op_id, acknowledged):
     """Execute insert, returning no results.
     """
     command = SON([('insert', self.collection.name),
                    ('ordered', self.ordered)])
     concern = {'w': int(self.ordered)}
     command['writeConcern'] = concern
     if self.bypass_doc_val and sock_info.max_wire_version >= 4:
         command['bypassDocumentValidation'] = True
     db = self.collection.database
     bwc = _BulkWriteContext(db.name, command, sock_info, op_id,
                             db.client._event_listeners, None, _INSERT,
                             self.collection.codec_options)
     # Legacy batched OP_INSERT.
     _do_batched_insert(self.collection.full_name, run.ops, True,
                        acknowledged, concern, not self.ordered,
                        self.collection.codec_options, bwc)
예제 #2
0
파일: bulk.py 프로젝트: ZJDong/Wayfindr-Py
 def execute_insert_no_results(self, sock_info, run, op_id, acknowledged):
     """Execute insert, returning no results.
     """
     command = SON([('insert', self.collection.name),
                    ('ordered', self.ordered)])
     concern = {'w': int(self.ordered)}
     command['writeConcern'] = concern
     if self.bypass_doc_val and sock_info.max_wire_version >= 4:
         command['bypassDocumentValidation'] = True
     db = self.collection.database
     bwc = _BulkWriteContext(
         db.name, command, sock_info, op_id, db.client._event_listeners,
         session=None)
     # Legacy batched OP_INSERT.
     _do_batched_insert(
         self.collection.full_name, run.ops, True, acknowledged, concern,
         not self.ordered, self.collection.codec_options, bwc)