Post your questions for the Realm AMA on July 16th, 2020 (EST)

Richard - one of our Developer Advocates Aaron Bassett did a live coding session covering some of this at MongoDB .Live in June. The recording should be on Youtube - I’ll find it and drop a link in here for you and along with any repo links too if available.

1 Like

Thank @Drew_DiPalma, but that response isn’t much more than we’ve heard already … coming, coming.

When is the near future expected? Scaling up the .NET team from how many to how many? I get the impression there isn’t anyone on the .NET team at the moment.

This is going to sound harsh, but my company uses Realm Cloud and we want it to succeed. The Realm AMA was woeful!

It was a mistake to give a getting started demo using the command line. There were numerous errors in the demonstration. Instead of making Realm seem easy to use, it made Realm look difficult to use.

Command-line demos with the screen flicking back and forth may be attractive to high-school nerds, but good luck making money from them. If you want to sell the product to companies that actually make money, you’ll need to do better to make the presentation appealing to decision makers in those companies.

An update on the React Native and Web tutorials.

After digging into the code and testing the React Native app, I realised that the app doesn’t actually implement anything at all with regard to data ownership!

For example, when you create a Task from the mobile app, it gets inserted into the Tasks collection without an assignee (so you have no way to know which user created it).

I also wanted to get both apps to work together, so I used the Relationship setting from the React Native tutorial to set the assignee to _id and NOT user_id. Therefore I would have hoped, with some code changes, that I could create data in both apps and see it from both apps, with the correct assigneed value.

I did manage to change the Web App so that if I manually updated a task in the collection to assign the owner, the web app could see that data and recognise that the logged in user in the web app owned that data, and thus you see it in the UI of the web app.

However, from the web app if you create a new Task, it runs a query to fetch the user data from the users collection BUT it sends the user’s id as a string, which does not match the BSON.ObjectId equivalent, and so it cannot find the user. Hence the web app also ends up creating Tasks with no assigned user.

In summary, I find that these tutorials hardly even scratch the surface, and indeed are utterly confusing to work with to understand how ONE realm app can be used to expose common Atlas data across both mobile and web. They actually make it feel like it is impossible to do.

Nick Larew, who I believe wrote some of the code, has actually left a console.log statement on line 59 of useDraftTask.tsx:

console.log("user", user);

and the user is always null. So clearly he had issues with ensuring this query worked.

What is also strange is this interface:

interface IRealmApp {
  id: string;
  user: Realm.User | null;
  logIn: (email: string, password: string) => Promise<void>;
  logOut: () => Promise<void>;
  registerUser(email: string, password: string): Promise<void>;

The user is defined as Realm.User and the User is defined in the nodes module ‘realm-web’:

 * Representation of an authenticated user of an app.
interface User {
     * The automatically-generated internal ID of the user.
    id: string;

So here the user id is a string, but in Atals collection it is a BSON.ObjectId. I believe this is why the above query cannot find the user and it’s always null, since a string and an ObjectId are not equivalent.

I would dearly love to see a tutorial that builds a single Realm App that shares data, including the idea of ‘who owns what’ (ie. assignee) between both apps. So a user logged in on mobile, for example, can only see their own data (as opposed to the current tutorial, where they see everything, but neither app can see who is assigned to what task).

All in all, an extremely frustrating experience.

Maybe it’s not 100% clear from my explanation above what the problem is. I made a video to explain it to a fellow developer, so here is the video, which goes into more detail:

Hi all,

Because the AMA has ended, I’m closing the topic. Please continue to publish your questions under the Realm category so our experts and your fellow community members can help you find answers.