Back

Database not found

  • 0
  • Web
Showtime
25 Jun, 2024, 16:57

I'm following the documentation on https://appwrite.io/docs/quick-starts/node and am getting a Database not found error. I've confirmed the database is getting created, but any time I try to access it programmatically it fails. I'm using node-appwrite 13.0.0

TypeScript
const databases = new sdk.Databases(client);

var todoDatabase;
var todoCollection;

async function prepareDatabase() {
    //This works
    todoDatabase = await databases.create(
        sdk.ID.unique(),
        'TodosDB'
    );

    //It errors here
    todoCollection = await databases.createCollection(
        todoDatabase.$id,
        sdk.ID.unique(),
        'Todos'
    );

}
TL;DR
Documentation is being followed to create a database using node-appwrite 13.0.0, but facing 'Database not found' error. The issue arises when trying to create a collection within the database programmatically. Solution: Ensure that the collection creation process is handled correctly. Double-check the syntax and parameters used for creating the collection within the database.
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more