问题
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?
回答1:
Yes. I have used this method in the past. It brings in mongod.exe and launches it.
Take a look here to see how it is done.
https://github.com/nosqlclient/nosqlclient-electron/blob/master/index.js
回答2:
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.
来源:https://stackoverflow.com/questions/46926506/can-mongodb-be-packaged-in-an-electron-app