Can i use online database in Expo ?

#1

Hi Guys,
I can’t use Mongodb or Mongojs in Expo.It failed to bundle and have no error message.I know that expo can use sqlite to be local database, but we need to use online database to collect user information.Can anyone suggest some online db for us?
Thank you.

#2

Easiest way would be to use firebase firestore or the RTDB. You could always use mongoDB on your server though and just connect to that

#3

Thanks for your answer, but i still have some question.
I try to use mlab, so i use “npm install mongojs”.and follow the example on the websites.
But when i use " var db = require(“mongojs”);", i recieve that i need to install “ulti”,after i install it, it still bundle error but have no message.So how can i connect to mlab when i use Expo ??
Thank you a lot!!

#4

mongojs : https://www.npmjs.com/package/mongojs

#5

Util is a node module for Node.js, and therefore you cannot use it with React Native. Similar to how fs or path works.
So if Mongojs uses util, I don’t think you can use that ORM. Maybe Mongoose can help you?

#6

I see, Thank you

#7

If you want to use mongodb, you’d need to run it on your server and then perform all db operations from there. You’d then need to use something like the fetch API to make https requests to your server with the data you want to update. As cronnay has suggested. Mongoose would probably be quite helpful to you

closed #8

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.