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
- [SOLVED] Error upgrading from 1.8.1 to 1...
DO Self-hosted server failed to upgrade with this error "Error response from daemon: client version 1.52 is too new. Maximum supported API version is 1.42". U...
- MariaDB refuses to connect to appwrite
Earlier, I tried updating my Appwrite version from 18.1.x to the latest release because my Flutter package required it to function properly. I used the official...
- executeFunction intermittently throws Fo...
Environment: Flutter app using the Appwrite Flutter SDK, calling executeFunction for [describe endpoint, e.g. live-stream-related function]. *Description*: Int...