From 69edec5c4dcffec6211ebaf7b39a2a57aa283070 Mon Sep 17 00:00:00 2001 From: Alex Gorbatchev Date: Sun, 2 Oct 2016 16:59:52 -0700 Subject: [PATCH] [rethinkdb] Fixes boolean operators --- rethinkdb/rethinkdb-tests.ts | 7 +++++++ rethinkdb/rethinkdb.d.ts | 8 ++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/rethinkdb/rethinkdb-tests.ts b/rethinkdb/rethinkdb-tests.ts index edfc5cc485..06a37eb504 100644 --- a/rethinkdb/rethinkdb-tests.ts +++ b/rethinkdb/rethinkdb-tests.ts @@ -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"); diff --git a/rethinkdb/rethinkdb.d.ts b/rethinkdb/rethinkdb.d.ts index 4c2a9ddb96..2b65617726 100644 --- a/rethinkdb/rethinkdb.d.ts +++ b/rethinkdb/rethinkdb.d.ts @@ -355,10 +355,10 @@ declare module "rethinkdb" { append(prop: string): Expression; contains(prop: string): Expression; - and(b: boolean): Expression; - or(b: boolean): Expression; - eq(v: any): Expression; - ne(v: any): Expression; + and(b: boolean | Expression): Expression; + or(b: boolean | Expression): Expression; + eq(v: any | Expression): Expression; + ne(v: any | Expression): Expression; not(): Expression; gt(value: T): Expression;