private void validateAsMongoDBFieldName ( String fieldName ) { if ( fieldName . startsWith ( "$" ) ) { throw log . fieldNameHasInvalidDollarPrefix ( fieldName ) ; } else if ( fieldName . contains ( "\u0000" ) ) { throw log . fieldNameContainsNULCharacter ( fieldName ) ; } }
Validates a String to be a valid name to be used in MongoDB for a field name .