
I noticed that official example using Query at the front end like this:
import { Client, Databases, Query } from "appwrite"
But I use it in node-appwrite at the server side like this:
import { Client, Databases, Query } from "node-appwrite"
Is it wrong about this? Is it can not work in node-appwrite sdk.

did you run the migrate command after upgrading?

that appwrite
is a client SDK. node-appwrite
is a server sdk. see https://appwrite.io/docs/sdks

yes, I have run the migrate command. 😫

It works for me 🧐

What results do you get if you filter for disabled = true?

It still lists all documents, same as never change the conditions. All conditions are not working at all. But the queries work well in local development env.

const client = new Client().setEndpoint(appwrite_endpoint).setProject(appwrite_project).setKey(appwrite_key);
const databases = new Databases(client);
const appwrite_conditions = [
Query.select(['$id', 'messageTitle']),
Query.equal('disabled', false),
Query.limit(10),
Query.orderDesc('created'),
];
const purpose = (context.query.purpose as string) ?? '';
if (purpose) {
appwrite_conditions.push(Query.equal('systemPurposeId', purpose));
}
return databases.listDocuments(appwrite_databaseId, appwrite_collectionId, appwrite_conditions).then(
(res: any) => {
return {
props: {
conversations: res.documents,
purpose: purpose,
},
};
},
(err) => {
return {
props: {
error: {
message: err.message ?? 'Unknown error.',
status: err.code ?? 500,
},
},
};
},
);

You have a local Appwrite instance and another Appwrite instance?

local for dev another at remote for prod

You definitely need to make sure you're connecting to the right instance...and the schemas match

How to view the logs of get documents with query to confirm the request url and test it?

Maybe traefik logs if it's enabled

To order you need to set "$createdAt"

With $

I have list all containers with command: docker ps And got the container id then checked the logs of traefik:2.7 image. There are only tow lines contents:
time="2023-05-27T02:20:01Z" level=info msg="Configuration loaded from flags."
time="2023-05-27T02:20:04Z" level=error msg="the router appwrite_realtime_wss@docker uses a non-existent resolver: dns"

accesslog is disable by default


You are right. But I defined a customized attribute named created.

Ok

Thanks.

I too have an issue with querying a collection using Query.equals('attribute','123') , i get nothing in return no matter what i do. I'm using cloud Appwrite so i cannot update it

Feel free to create a new post in <#1072905050399191082>

This post has been resolved. Earlier, I had changed the node-appwrite api request method from axios to fetch and losted the query parameter. Now, I have resumed and it is work well. It's all my fault.

[SOLVED] Queries not working
Recommended threads
- Attribute creation stuck at processing f...
Hey Appwrite community! 👋 I'm running into a persistent issue with my self-hosted Appwrite installation (v1.6.1) where programmatically creating attributes fo...
- Could not open input file: /usr/src/code...
I updated my selfhosted instance to `1.6.2` and the new service (`appwrite-task-stats-resources`) failed to start. The only log message I see is: ``` Could not ...
- 401 - Project is not accessible in this ...
This is on the app write console https://screen.aryanwadhera.tech/7YTVhLTf
