public void insert ( final DBObject document ) { isTrue ( "already executed" , ! closed ) ; if ( document . get ( ID_FIELD_NAME ) == null ) { document . put ( ID_FIELD_NAME , new ObjectId ( ) ) ; } addRequest ( new InsertRequest ( document , collection . getObjectCodec ( ) ) ) ; }
Add an insert request to the bulk operation