Back

AppwriteException: Invalid query: {"method":"equal","attribute":"accountId","values":["XXX"]}

  • 0
  • Cloud
Batocanin
16 Mar, 2024, 17:44

I was checking version 13.x and

TypeScript
    const currentUser = await databases.listDocuments(
      appwriteConfig.databaseId,
      appwriteConfig.userCollectionId,
      [Query.equal("accountId", currentAccount.$id)]
    );

This query select is working fine, but at 14.0.0 version, query.equal is giving error as title said.

What is new syntax and how to fix this?

TL;DR
Developers discussing issues with the Appwrite SDK versions and breaking changes. They suggest using older SDK versions if needed and recommend checking changelogs for breaking methods. A specific query syntax error is mentioned, suggesting using web SDK version 13.0.2 which is fully compatible with Appwrite 1.4. Upgrading Cloud to version 1.5 is planned in the coming weeks. Solution: Use web SDK version 13.0.2 to resolve the query syntax issue until Cloud is upgraded to Appwrite 1.5.
Batocanin
16 Mar, 2024, 17:45

Also query.contains not working.

Meldiron
16 Mar, 2024, 17:45

Hey there πŸ‘‹ May I ask, do you use Cloud or self-hosting?

Batocanin
16 Mar, 2024, 17:45

Cloud

Meldiron
16 Mar, 2024, 17:47

Thanks πŸ™Œ Cloud is currently running verison 1.4. This version does not have contains query yet. We plan to upgrade Cloud to version 1.5 in upcoming weeks.

Error you are seing is regarding new query syntax in general. Please use web SDK version 13.0.2, as that is fully compatible with Appwrite 1.4

Batocanin
16 Mar, 2024, 17:47

"appwrite": "^13.0.2" package.json

Batocanin
16 Mar, 2024, 17:48

I was just wondering, will it be 'fixed' lately or what?

Meldiron
16 Mar, 2024, 17:48

Hmm that shound work πŸ€” Let me quickly check source code of 13.x SDK

Batocanin
16 Mar, 2024, 17:49

It's working

Batocanin
16 Mar, 2024, 17:49

I just downgrade it from 14 to 13, all good.

Batocanin
16 Mar, 2024, 17:49

There's no error anymore, just curious will it works lately or?

Meldiron
16 Mar, 2024, 17:50

Yes, SDK 1.4 will work soon on Cloud. Keep an eye on announcment channel on Discord, we will announce when Cloud gets upgraded to latest Appwrite with all features presented during Init.

Meldiron
16 Mar, 2024, 17:51

We took this approach to allow open-source community to adapt to Appwrite 1.5 first, as we always had great success with open source community finding and fixing bugs quickly. This allowed us to have very stable release for Cloud.

I appreciate your feedback and Ill share it with the team to consider quicker Cloud release next time πŸ™

Batocanin
16 Mar, 2024, 17:52

Okay good, and one more thing...

createEmailSession is changed with createEmailPasswordSession and deleted in 14.x

That could make bugs lately when someone upgrade their site.

Meldiron
16 Mar, 2024, 17:53

Correct, SDKs can have breaking changes.

You can keep using older SDKs, they will remain to work perfectly fine.

If you do need some new feature from latest SDK, you will need to adapt to those breaking changes. 2 things I would recommend is to:

  • Check changelogs, they include notes about all breaking methods
  • Have build step in your app. Such build step will fail and show you all methods that became broken
Batocanin
16 Mar, 2024, 17:54

Okay, thanks, have a nice day.

Batocanin
16 Mar, 2024, 17:54

Also one more thing

Meldiron
16 Mar, 2024, 17:54

Always happy to help. Enjoy the weekend πŸ™Œ

Batocanin
16 Mar, 2024, 17:54

Actually

Batocanin
16 Mar, 2024, 17:54
Batocanin
16 Mar, 2024, 17:54

There's no option to delete all together?

Batocanin
16 Mar, 2024, 17:54

Auth

Meldiron
16 Mar, 2024, 17:55

In Console, there isn't a way to delete all users with one click. For such cleanup, you could use Server SDK and write a small script to achieve this. You could write this in Node, Python, PHP, Bash, Dart, Java, ...

Meldiron
16 Mar, 2024, 17:56

With every iteration to a service, our design team also improves existing screens. I can imagine this feature being added in next Auth service iteration πŸ€”

Batocanin
16 Mar, 2024, 17:56

Let's see, thanks, bye πŸ˜›

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