Back

Query is not valid

  • 0
  • Databases
  • Web
  • Cloud
Examinor
15 Mar, 2024, 03:45

[Query.equal('accountId', currentAccount.$id)] THis is the query which I am passing in list ```js async getCurrentUser(){ try { let currentAccount = await this.account.get()

TypeScript
        if(!currentAccount) throw Error

        const currentUser = await this.database.listDocuments(
          conf.DATABASE_ID,
          conf.USER,
          [Query.equal('accountId', currentAccount.$id)]
        )

        if(!currentUser) throw Error
        return currentUser.documents[0]
      } catch (error) {
        console.log(error);
        
      }
     }

}``` but getting error as this is not valid

TL;DR
Developers should ensure they are using the correct version of the SDK. For detailed support, share the exact error messages. The issue within the code snippet seems to be with the query construction. Ensure that the `Query` object is correctly imported and used.
Steven
15 Mar, 2024, 03:57

Double check you're using the right version of the SDK.

Fyi, it's best to share exact error messages to give people more detail.

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