Skip to content

Instantly share code, notes, and snippets.

@npiv
Created May 12, 2014 12:37
Show Gist options
  • Save npiv/c0fe72fb214642fb9029 to your computer and use it in GitHub Desktop.
Save npiv/c0fe72fb214642fb9029 to your computer and use it in GitHub Desktop.
r.db(dbName).table(tableName).filter(new DBLambda() {
@Override
public RTFluentRow apply(RTFluentRow row) {
return row.or(
row.and(
row.field("age").gt(20),
row.field("age").lt(30)
),
row.field("name").eq("heman")
);
}
}).run(con).size()
// Java 8
r.db(dbName).table(tableName).filter(row -> row.or(
row.and(
row.field("age").gt(20),
row.field("age").lt(30)
),
row.field("name").eq("heman")
)).run(con).size()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment