Need Help! I am writing the code below
TypeScript
Client client = FFAppState().appwriteClient;
Databases dbInstance = Databases(client);
DocumentList homesList = await dbInstance.listDocuments(
databaseId: FFAppConstants.dbInstance,
collectionId: FFAppConstants.homesCollection,
);
print('homesList => ${homesList.documents}');
return homesList.documents;
I am just getting the Instance not data, when I print it.
TL;DR
Developers are having trouble getting document list data using `listDocuments` method. The code just returns the instance not the data when printed.
Solution:
Make sure to use the `data` property of the `DocumentList` object to access the actual documents. Update the code like this:
```
Client client = FFAppState().appwriteClient;
Databases dbInstance = Databases(client);
DocumentList homesList = await dbInstance.listDocuments(
databaseId: FFAppConstants.dbInstance,
collectionId: FFAppConstants.homesCollection,
);
print('homesList => ${homesList.data}'); // Use data@darShan need help
Recommended threads
- Appwrite console is too heavy
The Appwrite console is too heavy And all of my services broken Any support , please
- 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...
- Increase by operators
I see appwrite have bunch of useful operators for querieng db. One more I would like to suggest is operators like increase the count of a int columns by 1,2.. ...