From 58f07c94a95751bed8ad349280a5d9a9e4d82b8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Egidio?= Date: Sat, 11 Jul 2020 05:04:31 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#45874=20Add=20supp?= =?UTF-8?q?ort=20to=20sample=20aggregate=20operator=20in=20Parse.Query=20b?= =?UTF-8?q?y=20@vegidio?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Vinicius Egidio --- types/parse/index.d.ts | 2 ++ types/parse/parse-tests.ts | 5 +++++ types/parse/ts3.7/index.d.ts | 2 ++ types/parse/v1/index.d.ts | 10 ++++++---- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/types/parse/index.d.ts b/types/parse/index.d.ts index 68ae023efb..d239cf1243 100644 --- a/types/parse/index.d.ts +++ b/types/parse/index.d.ts @@ -732,6 +732,8 @@ namespace Parse { skip?: number; // Sort documentation https://docs.mongodb.com/v3.2/reference/operator/aggregation/sort/#pipe._S_sort sort?: { [key: string]: 1 | -1 }; + // Sample documentation: https://docs.mongodb.com/v3.2/reference/operator/aggregation/sample/ + sample?: { size: number }; } // According to https://parseplatform.org/Parse-SDK-JS/api/2.1.0/Parse.Query.html#fullText diff --git a/types/parse/parse-tests.ts b/types/parse/parse-tests.ts index 14cf85e195..8190094166 100644 --- a/types/parse/parse-tests.ts +++ b/types/parse/parse-tests.ts @@ -160,6 +160,11 @@ function test_query() { objectId: '$name', }, }); + query.aggregate({ + sample: { + size: 1 + }, + }); // Find objects with distinct key query.distinct('name'); diff --git a/types/parse/ts3.7/index.d.ts b/types/parse/ts3.7/index.d.ts index fba8d7facc..09c3a76193 100644 --- a/types/parse/ts3.7/index.d.ts +++ b/types/parse/ts3.7/index.d.ts @@ -704,6 +704,8 @@ namespace Parse { skip?: number; // Sort documentation https://docs.mongodb.com/v3.2/reference/operator/aggregation/sort/#pipe._S_sort sort?: { [key: string]: 1 | -1 }; + // Sample documentation: https://docs.mongodb.com/v3.2/reference/operator/aggregation/sample/ + sample?: { size: number }; } // According to https://parseplatform.org/Parse-SDK-JS/api/2.1.0/Parse.Query.html#fullText diff --git a/types/parse/v1/index.d.ts b/types/parse/v1/index.d.ts index 41107c76a3..9d7850f666 100644 --- a/types/parse/v1/index.d.ts +++ b/types/parse/v1/index.d.ts @@ -668,13 +668,15 @@ declare namespace Parse { // According to http://docs.parseplatform.org/rest/guide/#aggregate-queries interface AggregationOptions { - group?: { objectId?: string, [key:string]: any }; - match?: {[key: string]: any}; - project?: {[key: string]: any}; + group?: { objectId?: string, [key: string]: any }; + match?: { [key: string]: any }; + project?: { [key: string]: any }; limit?: number; skip?: number; // Sort documentation https://docs.mongodb.com/v3.2/reference/operator/aggregation/sort/#pipe._S_sort - sort?: {[key: string]: 1|-1}; + sort?: { [key: string]: 1 | -1 }; + // Sample documentation: https://docs.mongodb.com/v3.2/reference/operator/aggregation/sample/ + sample?: { size: number }; } // According to https://parseplatform.org/Parse-SDK-JS/api/2.1.0/Parse.Query.html#fullText