Documents not listing in appwrite

60 Views Asked by At

I have a react native app which uses appwrite for BE. I have created database,collection and documents. But when i run the FE query its showings as documents 0. why is that? am i missing anything?

const client = new Client();
client
.setEndpoint('endpoint')
.setProject('id');
const databases = new Databases(client);

let promise = databases.listDocuments(
"[databaseid]",
"[collectionid]",
[
    Query.equal('title')
]

);

promise.then(function (response) {
    console.log(response);
}, function (error) {
    console.log(error);
});
1

There are 1 best solutions below

0
On

You've used Query.equal(), but haven't given any value to search for.

Query.equal() is called like so: Query.equal("ATTRIBUTE", ["SEARCHTERM1", "SEARCHTERM2", ...]).