Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can MongoDB be packaged in an Electron app?

Can I package MongoDB in an Electron app so I don't need to install it on a client's machine? I'm developing an app on OSX and it will probably be used on Windows. Do I need to separately install Mongo on the clients?

like image 589
David J. Avatar asked Oct 25 '17 07:10

David J.


People also ask

Can I use MongoDB with Electron?

Electron JS is a framework to build and run desktop apps using Javascript. More info on it can be found here. Using Electron JS apps with MongoDB is straightforward. Use the already running MongoDB server and a library like Mongoose to get going.

What database should I use for Electron app?

If your electron app state is beyond what localStorage can manage, you need to bundle a database. NEDB is a mongo API compatible, file-based database. It's a great fit for electron apps.

Is MongoDB a compass Electron?

MongoDB Compass now uses: Electron version 13.

Where does an Electron app store data?

The data is saved in a JSON file named config. json in app. getPath('userData') . You can use this module directly in both the main and renderer process.


2 Answers

You can actually use indexeddb which is a JavaScript-based object-oriented database.

like image 192
Sofonias Abathun Avatar answered Sep 21 '22 07:09

Sofonias Abathun


The simple and obvious answer is: No. MongoDB is AFAIK not embeddable, at least not in any sense of the word straightforward.

But the real question is, what problem do you want to solve? Perhaps is PouchDB the database, you want to ship with your app.

like image 32
Thomas Junk Avatar answered Sep 22 '22 07:09

Thomas Junk