Back

Not able to use Query.equal and getting bellow error --

  • 0
  • Self Hosted
  • Databases
  • Web
Avidev-creator
9 Apr, 2024, 10:52
TypeScript
Invalid query: {"method":"equal","attribute":"status","values":["active"]}
TL;DR
Developers experiencing an issue with using Query.equal in their code, getting an "Invalid query" error. The correct method should be `Query.equal('status', 'active')`.
Avidev-creator
9 Apr, 2024, 10:52

My Code is below ---

Avidev-creator
9 Apr, 2024, 10:52
TypeScript
async getPosts() {
    try {
      const response = await this.databases.listDocuments(
        conf.appwriteDatabaseId,
        conf.appwriteCollectionId,
        [Query.equal('status', 'active')]
      );

      console.log(response.documents);

      return response;
    } catch (error) {
      console.log(error);
    }
  }
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more