use of org.bson.BsonRegularExpression in project mongo-java-driver by mongodb.
the class JsonReaderTest method testRegExp.
@Test
public void testRegExp() {
String json = "RegExp(\"abc\",\"im\")";
bsonReader = new JsonReader(json);
assertEquals(BsonType.REGULAR_EXPRESSION, bsonReader.readBsonType());
BsonRegularExpression regularExpression = bsonReader.readRegularExpression();
assertEquals("abc", regularExpression.getPattern());
assertEquals("im", regularExpression.getOptions());
}
Aggregations