|
I believe I found an error in the docs for the web SDK. There is a section on "Instantiate a MongoDB connection handle" that has this:
const mongo = app.currentUser.mongoClient(CLUSTER_NAME);
const collection = mongo.db(DATABASE_NAME).collection(COLLECTION_NAME);
However, the CLUSTER_NAME is wrong because it is actually the SERVICE_NAME you have defined in your App Services rather than the actual name of the cluster.
Therefore, with the CLUSTER NAME, you get
{
error: "service not found: 'Cluster'"
error_code: "ServiceNotFound"
link: "
[https://realm.mongodb.com/groups/605b5f523a31670497f95b7c/apps/623c2b2762f89a348641d34d/logs?co_id=6377b60b4839c96a17c5d04a]
"
}
With the service name works well.
|