MongodbPredicate { public String asMatch() throws PushDownOptimizationException { return JSON.serialize( QueryBuilder.start( MATCH ).is( conditionAsDBObject() ).get() ); } MongodbPredicate( Condition condition, ValueMetaResolver resolver, Map<String, String> fieldMappings ); String asMatch(); String asFilterCriteria();  }
@Test public void testMatch() throws KettleException { assertJsonEquals( "{\"$match\":{\"$or\":[{\"sField1\":\"baz\"},{\"sField2\":{\"$ne\":\"foo\"}}]}}", asMatch( condition( "sField1 = 'baz' OR NOT (sField2 = 'foo')" ) ) ); }
@Test public void testLike() throws KettleException { assertJsonEquals( "{ \"$match\" : { \"sField1\" : { \"$regex\" : \".*?foo.*?\" , \"$options\" : \"is\"}}}", asMatch( condition( "sField1 LIKE '%foo%'" ) ) ); }