React Developer
Hi, I follow a tutorial here https://www.youtube.com/watch?v=YSUmzHH_OMg but cannot connect to my personal database using this method:
const {documents, total} = await database.listDocuments(databaseId,tableId);
The listDocuments method is crossed over and deprecated, in fact all methods in that database object are deprecated. Database is initiated by:
import {Client, Databases} from 'react-native-appwrite';
import { Platform } from 'react-native';
const client = new Client();
client
.setEndpoint('https://fra.cloud.appwrite.io/v1')
.setProject(myProjectId);
switch (Platform.OS) {
case 'ios':
client.setPlatform('com.example.test');
break;
case 'android':
client.setPlatform('com.example.test');
break;
default:
break;
}
const database = new Databases(client);
export {client, database};
When I start expo, the table row is not returned into the app