Back

[SOLVED] Query.select error

  • 0
  • Web
BloodThermic
4 May, 2023, 00:20

I am getting this error when I am using Query.select

caught (in promise) AppwriteException: Query method not valid: select

This is my code it is trying to run. everything works but Query.

TypeScript
  import Nav from "$lib/components/nav.svelte";
  import { onMount } from "svelte";
  import { Client, Account, Databases, Query } from "appwrite";

  const client = new Client();
  const account = new Account(client);
  const databases = new Databases(client);

  client
    .setEndpoint("http://localhost:3080/v1") // Your API Endpoint
    .setProject("63db6c4c0a25ec0b287d"); // Your project ID

  let accountName;
  let accountEmail;
  let accountPhone;

  onMount(async () => {
    const accountDetails = await account.get();
    accountName = accountDetails.name;
    accountEmail = accountDetails.email;
    accountPhone = accountDetails.phone;

    const docs = databases.listDocuments(
      "64502243369b884d71f8",
      "6450225bbca140600f16",
      [Query.select(["name"])]
    );

    console.log((await docs).documents.feet);
  }); ```
TL;DR
The user was experiencing an error when using the `Query.select` method in their code. They mentioned that everything else was working fine except for this. They also provided the version of Appwrite they were using (`"appwrite": "^11.0.0"` and `"node-appwrite": "^9.0.0"`). The solution to the issue is not explicitly mentioned in the thread. However, since the user mentioned that the error was resolved, it can be inferred that they were able to fix the problem on their own.
Drake
4 May, 2023, 00:24

What version of Appwrite are you on?

BloodThermic
4 May, 2023, 00:47

"appwrite": "^11.0.0", "node-appwrite": "^9.0.0"

Drake
4 May, 2023, 01:04

Version of Appwrite, not the sdks

BloodThermic
4 May, 2023, 01:06

Like what dockers is running? if so idk how to check

Drake
4 May, 2023, 01:06

docker ps

BloodThermic
4 May, 2023, 01:07

1.20

Drake
4 May, 2023, 01:08

The select query was introduced in 1.3

BloodThermic
4 May, 2023, 01:08

Ok i see. I will figure out how to update

BloodThermic
4 May, 2023, 01:17

I got it all working Thank you!

BloodThermic
4 May, 2023, 01:17

[SOLVED] Query.select 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