Back

[SOLVED] SELECT Query Error

  • 0
  • Databases
  • Web
Ankan
14 Jul, 2023, 13:49

I was running a query to get some data from the data in the following format

TypeScript
async searchProduct(productName: string) {
        return appwriteDatabase.listDocuments(
            process.env["NEXT_PUBLIC_APPWRITE_DATABASE_ID"] ?? "",
            process.env["NEXT_PUBLIC_APPWRITE_PRODUCT_COLLECTION_ID"] ?? "",
            [
                Query.select(["name", "description", "cover_image"]),
                Query.search("name", productName),
                Query.orderDesc("$createdAt"),
            ]
        );
    }

And I am receiving the following error

TypeScript
Query Method not valid: Select

Also all the properties exist in the database.

TL;DR
The user was experiencing an error with their `SELECT` query. They were using a cloud version that was not updated to support the `SELECT` query introduced in version `1.3.x`. The user shared their code and the error message they were receiving. There is no specific date mentioned for an update to the cloud version.
Binyamin
14 Jul, 2023, 13:50

Select is query that was added in version 1.3.x https://dev.to/appwrite/join-celebrations-appwrite-13-ships-relationships-57fc

If you're using the cloud this won't be possible right now as the cloud still uses version 1.1.x

Ankan
14 Jul, 2023, 13:51

Okk got it. I am using the cloud so when the cloud version gets updated would the existing project also get updated to the latest version features?

Binyamin
14 Jul, 2023, 13:53

There Is no specific date. but it seems like soon.

Ankan
14 Jul, 2023, 13:53

Okk got it thanks for the help btw😊😊

Tessa
14 Jul, 2023, 21:00

[SOLVED] SELECT Query Error

Drake
15 Jul, 2023, 00:46
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