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