From f7b8364e3cdc8b8c60aea9bf01de429e839ee779 Mon Sep 17 00:00:00 2001 From: Gregory Ristow Date: Thu, 9 Aug 2018 15:38:10 -0400 Subject: [PATCH] fix(rethinkdb): Add getAll overloads for compound-index keys --- types/rethinkdb/index.d.ts | 102 +++++++++++++++++++++++++++++++++++-- 1 file changed, 98 insertions(+), 4 deletions(-) diff --git a/types/rethinkdb/index.d.ts b/types/rethinkdb/index.d.ts index 0f0358cb32..820c1b5f11 100644 --- a/types/rethinkdb/index.d.ts +++ b/types/rethinkdb/index.d.ts @@ -268,11 +268,105 @@ declare module "rethinkdb" { insert(obj: any, options?: InsertOptions): Operation; get(key: string): Operation & Writeable; + + /** + * Get all documents matching one or more keys on a simple index; defaults to primary key if no index provided. + * See [getAll](https://www.rethinkdb.com/api/javascript/get_all/) + */ + getAll(...keys: string[]): Sequence; + /** + * Get all documents matching a key on a simple index; defaults to primary key if no index provided. + * See [getAll](https://www.rethinkdb.com/api/javascript/get_all/) + */ getAll(key: string, index?: Index): Sequence; // without index defaults to primary key - getAll(...keys: string[]): Sequence; - getAll(...keys: string[]): Sequence; - getAll(keys: Expression): Sequence; - getAll(key: Expression): Sequence; + /** + * Get all documents matching 2 or more keys on a simple index; defaults to primary key if no index provided. + * See [getAll](https://www.rethinkdb.com/api/javascript/get_all/) + */ + getAll(key: string, key2: string, index?: Index): Sequence; // without index defaults to primary key + /** + * Get all documents matching 2 or more keys on a simple index; defaults to primary key if no index provided. + * See [getAll](https://www.rethinkdb.com/api/javascript/get_all/) + */ + getAll(key: string, key2: string, key3: string, index?: Index): Sequence; // without index defaults to primary key + /** + * Get all documents matching 2 or more keys on a simple index; defaults to primary key if no index provided. + * See [getAll](https://www.rethinkdb.com/api/javascript/get_all/) + */ + getAll(key: string, key2: string, key3: string, key4: string, index?: Index): Sequence; // without index defaults to primary key + /** + * Get all documents matching 2 or more keys on a simple index; defaults to primary key if no index provided. + * See [getAll](https://www.rethinkdb.com/api/javascript/get_all/) + */ + getAll( + key: string, + key2: string, + key3: string, + key4: string, + key5: string, + index?: Index + ): Sequence; // without index defaults to primary key + /** + * Get all documents matching a compound index key. + * See [getAll](https://www.rethinkdb.com/api/javascript/get_all/) and + * [compound indexes](https://www.rethinkdb.com/docs/secondary-indexes/javascript/#compound-indexes) + */ + getAll(compoundKey: string[], index: Index): Sequence; // without index defaults to primary key + /** + * Get all documents matching 2 or more compound index keys. + * See [getAll](https://www.rethinkdb.com/api/javascript/get_all/) and + * [compound indexes](https://www.rethinkdb.com/docs/secondary-indexes/javascript/#compound-indexes) + */ + getAll(compoundKey: string[], compoundKey2: string[], index?: Index): Sequence; // without index defaults to primary key + /** + * Get all documents matching 2 or more compound index keys. + * See [getAll](https://www.rethinkdb.com/api/javascript/get_all/) and + * [compound indexes](https://www.rethinkdb.com/docs/secondary-indexes/javascript/#compound-indexes) + */ + getAll( + compoundKey: string[], + compoundKey2: string[], + compoundKey3: string[], + index: Index + ): Sequence; // without index defaults to primary key + /** + * Get all documents matching 2 or more compound index keys. + * See [getAll](https://www.rethinkdb.com/api/javascript/get_all/) and + * [compound indexes](https://www.rethinkdb.com/docs/secondary-indexes/javascript/#compound-indexes) + */ + getAll( + compoundKey: string[], + compoundKey2: string[], + compoundKey3: string[], + compoundKey4: string[], + index: Index + ): Sequence; // without index defaults to primary key + /** + * Get all documents matching 2 or more compound index keys. + * See [getAll](https://www.rethinkdb.com/api/javascript/get_all/) and + * [compound indexes](https://www.rethinkdb.com/docs/secondary-indexes/javascript/#compound-indexes) + */ + getAll( + compoundKey: string[], + compoundKey2: string[], + compoundKey3: string[], + compoundKey4: string[], + compoundKey5: string[], + index: Index + ): Sequence; // without index defaults to primary key + /** + * Get all documents matching a key on a simple index; defaults to primary key if no index provided. + * See [getAll](https://www.rethinkdb.com/api/javascript/get_all/) and + * [compound indexes](https://www.rethinkdb.com/docs/secondary-indexes/javascript/#compound-indexes) + */ + getAll(key: Expression, index?: Index): Sequence; + /** + * Get all documents matching a key on a compound index; index must be provided. + * See [getAll](https://www.rethinkdb.com/api/javascript/get_all/) and + * [compound indexes](https://www.rethinkdb.com/docs/secondary-indexes/javascript/#compound-indexes) + */ + getAll(keys: Expression, index: Index): Sequence; + getIntersecting(geometry: Geometry, index: Index): Sequence; wait(WaitOptions?: WaitOptions): Operation;