private static Document objectForInsert ( Tuple tuple , Document dbObject ) { MongoDBTupleSnapshot snapshot = ( MongoDBTupleSnapshot ) tuple . getSnapshot ( ) ; for ( TupleOperation operation : tuple . getOperations ( ) ) { String column = operation . getColumn ( ) ; if ( notInIdField ( snapshot , column ) ) { switch ( operation . getType ( ) ) { case PUT : MongoHelpers . setValue ( dbObject , column , operation . getValue ( ) ) ; break ; case PUT_NULL : case REMOVE : MongoHelpers . resetValue ( dbObject , column ) ; break ; } } } return dbObject ; }
Creates a Document that can be passed to the MongoDB batch insert function