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?
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.
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.
MongoDB Compass now uses: Electron version 13.
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.
You can actually use indexeddb which is a JavaScript-based object-oriented database.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With