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
- Weird permission failure
when creating an account I use following methods: ``` Future<void> register(String email, String password, String username) async { final user = await accoun...
- Flutter Android oAuth is no more working
I currently don't get the oAuth login to work in flutter android. it works on ios and on web. but when try to use it on Android, i get to the point where the ca...
- Relation Question
How do I create a relation from table y to an others x.$id. in my example I have a users table where I use Appwrites unique User IDs and I want other tables fo...