(self, document)
Add an insert document to the list of ops.
Add an insert document to the list of ops.
Add an insert document to the list of ops .
def add_insert(self, document):
        """Add an insert document to the list of ops.
        """
        validate_is_document_type("document", document)
        # Generate ObjectId client side.
        if not (isinstance(document, RawBSONDocument) or '_id' in document):
            document['_id'] = ObjectId()
        self.ops.append((_INSERT, document))
def add_insert ( self , document ) : validate_is_document_type ( "document" , document ) # Generate ObjectId client side. if not ( isinstance ( document , RawBSONDocument ) or '_id' in document ) : document [ '_id' ] = ObjectId ( ) self . ops . append ( ( _INSERT , document ) )