diff --git a/package.json b/package.json index e2df6c20..47a8cebb 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "react-native-appwrite", "homepage": "https://appwrite.io/support", "description": "Appwrite is an open-source self-hosted backend server that abstracts and simplifies complex and repetitive development tasks behind a very simple REST API", - "version": "0.23.1", + "version": "0.24.0", "license": "BSD-3-Clause", "main": "dist/cjs/sdk.js", "exports": { diff --git a/src/client.ts b/src/client.ts index 660f9237..816d86a7 100644 --- a/src/client.ts +++ b/src/client.ts @@ -153,7 +153,7 @@ class Client { 'x-sdk-name': 'React Native', 'x-sdk-platform': 'client', 'x-sdk-language': 'reactnative', - 'x-sdk-version': '0.23.1', + 'x-sdk-version': '0.24.0', 'X-Appwrite-Response-Format': '1.8.0', }; diff --git a/src/query.ts b/src/query.ts index 5b33fb2a..0c89adec 100644 --- a/src/query.ts +++ b/src/query.ts @@ -126,7 +126,9 @@ export class Query { /** * Filter resources where attribute contains the specified value. + * For string attributes, checks if the string contains the substring. * + * Note: For array attributes, use {@link containsAny} or {@link containsAll} instead. * @param {string} attribute * @param {string | string[]} value * @returns {string} @@ -134,6 +136,30 @@ export class Query { static contains = (attribute: string, value: string | any[]): string => new Query("contains", attribute, value).toString(); + /** + * Filter resources where attribute contains ANY of the specified values. + * For array and relationship attributes, matches documents where the attribute + * contains at least one of the given values. + * + * @param {string} attribute + * @param {any[]} value + * @returns {string} + */ + static containsAny = (attribute: string, value: any[]): string => + new Query("containsAny", attribute, value).toString(); + + /** + * Filter resources where attribute contains ALL of the specified values. + * For array and relationship attributes, matches documents where the attribute + * contains every one of the given values. + * + * @param {string} attribute + * @param {any[]} value + * @returns {string} + */ + static containsAll = (attribute: string, value: any[]): string => + new Query("containsAll", attribute, value).toString(); + /** * Filter resources where attribute does not contain the specified value. *