Skip to content

Introducing new Database operators: or & contains query methods_

What is a database without queries? Not a lot. That's why we’re happy to announce a new set of query methods, array contains, text contains, and OR operators to Appwrite Databases.

5 min readUpdated Jun 29, 2026

We've added two new query methods, or and contains, to Appwrite Databases. By adding array element matches, partial text matches, as well as logical OR queries, we allow for more flexibility in managing your data.

These two query methods have been highly requested by the Appwrite community, and we’re excited to show you how to use them, so let’s jump in and take a look!

  • contains - partial text matches on text columns, array element matching on array columns
  • or - write logical OR queries

Contains operator

The contains operator is a great addition to the existing text search operators such as startsWith & endsWith, and can be used in combination with these two. With contains, we can now perform a broader search by matching against any text within a substring. This is extremely useful when searching a large body of text or when the placement of keywords is unknown.

JavaScript
tablesDB.listRows({
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
queries: [
Query.contains('content', ['happy', 'love'])
]
});

It’s important to note that the contains operator also works on array columns as well. For example, if we set a text column to act as an array, you could search this array in the same way you would search any other text value.

JavaScript
Query.contains('tags', ['mystery', 'comedy', 'PG-13'])

 

Or operator

The logical OR operator allows us to nest queries in an OR condition. This gives us the ability to group queries together for more dynamic search.

To use the OR operator pass Query.or([...]) to the queries array and provide at least two queries within the nested array.

JavaScript
tablesDB.listRows({
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
queries: [
Query.or([
Query.contains('name','ivy'),
Query.greaterThan('age',30)
])
]
});

The example shown will return all people that contain the substring 'ivy' somewhere in their name OR are older than 30 years old. Previously, there was no native way to do this kind of search from Appwrite's SDKs.

Database improvements

With these new database improvements you have more possibilities for data retrieval and manipulation, and add powerful new queries and logic to Appwrite Databases for you to manage your data. Making Appwrite Databases an even more powerful and complete product for you to build with.

Resources

Visit our documentation to learn more about Database operators, join us on Discord to be part of the discussion, view our blog and YouTube channel, or visit our GitHub repository to see our open-source code.

Database operators will be available as part of the Appwrite 1.5 release on GitHub and Cloud in March 2024.

Read next

Introducing Appwrite Explorer

Eldad Fux

Appwrite Explorer brings the Appwrite REST API into the Console. Browse every endpoint, build requests with guided forms, send live calls against your project, and inspect responses without leaving the browser.

8 min read

Introducing Appwrite Terminal

Eldad Fux

Appwrite Terminal runs the Appwrite CLI directly inside the Console. Your session and project context are preconfigured, with keyboard-first controls and multi-tab workflows, so you can inspect resources without leaving the project.

7 min read

Ready to build?_