Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-15750

[Realm Web] CLUSTER -> DATA_SOURCE

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Realm
    • Labels:
      None

      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.

            Assignee:
            nick.larew@mongodb.com Nicholas Larew
            Reporter:
            josman.perez@mongodb.com Josman Perez Exposito
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              1 year, 20 weeks, 6 days ago