[DOCS-15750] [Realm Web] CLUSTER -> DATA_SOURCE Created: 19/Nov/22  Updated: 04/Jan/23  Resolved: 23/Nov/22

Status: Closed
Project: Documentation
Component/s: Realm
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Josman Perez Exposito Assignee: Nicholas Larew
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:
Days since reply: 1 year, 11 weeks, 1 day ago

 Description   

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.



 Comments   
Comment by Nicholas Larew [ 22/Nov/22 ]

https://github.com/mongodb/docs-realm/pull/2310

Generated at Thu Feb 08 08:13:47 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.