Link Search Menu Expand Document

7. Connect Realm With Data

You have imported your Realm app! Now, let’s create a Realm user…

  1. Add a Realm user - this will be the global administrative user who logs into your application.
    1. In the Realm UI, click on ‘App Users’ under Data Access, and then click on the green “Add New User” button. adding new user button location

    2. Add an email address as the username, and add a password. Write these down in the template under “App Admin username” and “App Admin password”. As the global administrative login, you can use your email or whatever login you want for the global administrative user. The email is only used if you forget your password: adding information for creating user

    3. Copy the Realm User ID and paste in the template under “Realm User ID” using realm id instructions

  2. Insert a new document to the wildaid database. You will be inserting into the User collection using Compass, mongo shell or code studio integration.

    The User collection does not exist, so you will need to create it in Compass. In mongoshell and your code studio integration, the collection is automatically created.

    Set the email and realmUserID with the “App Admin user” and “Realm User ID”, set the agency to “WildAid” (for testing) and first and last names as appropriate. Here’s an example using mongoshell:
$ mongo "mongodb+srv://ofish-xxxx.mongodb.net/wildaid" --username admin
use wildaid;
db.User.insertOne(
  {"email":"sheeri.cabral@mongodb.com",
  "name": {"first":"Sheeri", "last":"Cabral"},
  "realmUserID": "xxxxxxxxxxxxxxxxxxxxx",
  "agency": {"name":"WildAid", "admin":false},
  "global": {"admin":true}
})

and here’s a template with empty fields for copy/pasting:

db.User.insertOne(
  "email":"",
  "name": {"first":"", "last":""},
  "realmUserID": "",
  "agency": {"name":"", "admin":false},
  "global": {"admin":true}
})

Fantastic!



Troubleshooting - Up to main build page