Merge pull request #29132 from ChrisGrant/master

[parse] Added fullText function to Parse.Query
This commit is contained in:
Andrew Casey
2018-10-05 10:11:10 -07:00
committed by GitHub
2 changed files with 9 additions and 0 deletions
+8
View File
@@ -634,6 +634,7 @@ declare namespace Parse {
exists(key: string): Query<T>;
find(options?: Query.FindOptions): Promise<T[]>;
first(options?: Query.FirstOptions): Promise<T | undefined>;
fullText(key: string, value: string, options?: Query.FullTextOptions): Query<T>;
get(objectId: string, options?: Query.GetOptions): Promise<T>;
greaterThan(key: string, value: any): Query<T>;
greaterThanOrEqualTo(key: string, value: any): Query<T>;
@@ -675,6 +676,13 @@ declare namespace Parse {
// Sort documentation https://docs.mongodb.com/v3.2/reference/operator/aggregation/sort/#pipe._S_sort
sort?: {[key: string]: 1|-1};
}
// According to https://parseplatform.org/Parse-SDK-JS/api/2.1.0/Parse.Query.html#fullText
interface FullTextOptions {
language?: string;
caseSensitive?: boolean;
diacriticSensitive?: boolean;
}
}
/**
+1
View File
@@ -83,6 +83,7 @@ function test_query() {
const query = new Parse.Query(GameScore);
query.equalTo("playerName", "Dan Stemkoski");
query.notEqualTo("playerName", "Michael Yabuti");
query.fullText("playerName", "dan", { language: 'en', caseSensitive: false, diacriticSensitive: true });
query.greaterThan("playerAge", 18);
query.limit(10);
query.skip(10);