Is that a normal practice to use direct access to MongoDB?

Is that a normal practice to use direct access to MongoDB for complicated requests bypassing Parse wrapper?

I’d try to keep all the queries as much as possible through Parse. You can also use aggregate, which give you a lot more flexibility. Could you give an example of query that you wanted to bypass Parse and why?

That is more for the future, not for existing cases. I will try to use only Parse API of course. I have the case where I must use transaction in a good way but put aside it at this moment. You wrote that transactions “supported via REST API” and I wanted an alternative. And alternative for whatever may be.

You usually don’t. I used to use it for aggregation, but now it’s included.
I still use it for searches that use collation indexes. Those queries only return ids, then I do a standard Parse query.
Oh, and I still use it to login on the server (and get a sessionToken) and getting a user from a sessionToken. Maybe it’s possible using standard Parse API, but I don’t know how.

Parse.User.login() retrieves the session token and user data automatically and saves them to local storage.

await Parse.User.logIn(data.email, data.password, {
   success: onSuccess(),
});

logIn can indeed be used on the server, to get a sessionToken, but there’s no local storage on the server :slight_smile:

1 Like