This is my code
While this is my error
I looked into the appwrite SDK code as well The equal method is well defined, in it
yes, but you're not using it right
thanks but I did refer that quite some times I cannot use this line
import { Client, Databases, Query } from "appwrite";
gives me a bunch of error on server side
but importing like this works
const sdk = require("node-appwrite");
But this does not seem to work
const query = sdk.Query()
So was trying to do it that way
well appwrite is the web sdk...given the docs, how do you think you'd do it with the node sdk?
I tried doing with
const sdk = require("node-appwrite");
const query = sdk.Query();
// Now while using
query.equal(attribute, value);
// this should have worked I guess```
well that didn't work and that doesn't look like the docs, right?
https://appwrite.io/docs/products/databases/databases
I was following this server sdk
I will try doing
import { Client, Databases, Query } from "node-appwrite";
no, your import is fine
I am sorry I am not able to catch the correction
I guess it is in function calling maybe
line
query.equal()
I mean
right, that's the incorrect part. does that look like what's in the docs?
sir please reply my message
Thanks a lot @Steven It clicked me
Instead of this now doing
const query = sdk.Query;
query.equal();
Now I can access the equal function correctly thanks a lot
[SOLVED] Cannot Access Queries.equal() on server side
more specifically, it's just sdk.Query.equal(). the sdk.Query is the same as the Query in the web sdk. the big difference is just in how it's imported when doing import vs require. you can even do:
const sdk = require("node-appwrite");
const { Client, Databases, Query } = sdk;
that's how static functions are invoked. you don't need to instantiate an object
Recommended threads
- Usage of the new Client() and dealing wi...
Hey guys, just a quick one - we had some web traffic the other day and it ended up bombing out - To put in perspective of how the app works, we have a Nuxt Ap...
- [Beginner] CLI --queries Syntax Error & ...
Hi everyone! I am a beginner with Appwrite and trying to use the CLI, but I'm stuck with a syntax error. Any guidance would be greatly appreciated! 🙏 **Enviro...
- [SOLVED] curl error Number: 6 — function...
Hello, I invested a lot of time in this error in a fresh install of appwrite 1.8.1 and lasted until fix, this if for helping anyone that can have the same weird...