const clientPromise = stitch.StitchClientFactory.create('myappid');clientPromise.then(client => {const db = client.service('mongodb', 'mongodb-atlas').db('mydb-db');client.login().then(() =>db.collection('words').find({ owner_id: client.authedId() }).limit(100).execute()).then(docs => {console.log("Found docs", docs)console.log("[MongoDB Stitch] Connected to Stitch")}).catch(err => {console.error(err)});});
What im missing here?
Hi Guilherme,
Looks like there is something off about the authentication. Check whether your myappid application has access to the database mydb-db.
If you’re still having difficulties connecting using Stitch, I would suggest to contact Cloud Support for Stitch and provide a sample application code.
Regards,
Wan.