Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
};

Expand Down
26 changes: 26 additions & 0 deletions src/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,40 @@ 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}
*/
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.
*
Expand Down