[rethinkdb] Fixes boolean operators

This commit is contained in:
Alex Gorbatchev
2016-10-02 16:59:52 -07:00
parent 4601d7808d
commit 69edec5c4d
2 changed files with 11 additions and 4 deletions

View File

@@ -15,6 +15,13 @@ r.connect({ host: "localhost", port: 28015 }, function(err: Error, conn: r.Conne
r.table("players").filter(r.row.hasFields("games_won").not()).run(conn, errorAndCursorCallback);
r.table("players").filter(r.row.hasFields({ "games_won": { "championships": true } }).not()).run(conn, errorAndCursorCallback);
r.table("players").filter(
r.row.hasFields("games_won").not()
.or(r.row("games_won").not().eq(true))
.and(true)
)
.run(conn, errorAndCursorCallback);
testDb.tableCreate("users").run(conn, function(err, stuff) {
const users = testDb.table("users");

View File

@@ -355,10 +355,10 @@ declare module "rethinkdb" {
append(prop: string): Expression<Object>;
contains(prop: string): Expression<boolean>;
and(b: boolean): Expression<boolean>;
or(b: boolean): Expression<boolean>;
eq(v: any): Expression<boolean>;
ne(v: any): Expression<boolean>;
and(b: boolean | Expression<boolean>): Expression<boolean>;
or(b: boolean | Expression<boolean>): Expression<boolean>;
eq(v: any | Expression<any>): Expression<boolean>;
ne(v: any | Expression<any>): Expression<boolean>;
not(): Expression<boolean>;
gt(value: T): Expression<boolean>;