Embed Mongodb with Electron

孤街浪徒 提交于 2019-12-06 01:11:31

As far as I know, you cannot package MongoDB with Electron, it must be installed separately. Quoting from this site: https://www.techiediaries.com/electron-data-persistence/

Pros and Cons of Using MongoDB

For the pros of using MongoDB with Electron apps:

  • Available for all Electron suppored platforms such as Windows, Linux and MAC. So it doesn't limit the cross platform feature of Electron.

  • Can be installed and integrated easily with Electron.

There are also some cons:

  • Can't be bundled with Electron so the end users need to install it separately from your application.
  • Overkill for small apps.

Instead, might I suggest using NeDB - https://github.com/louischatriot/nedb

NeDB uses a subset of the MongoDB API so you shouldn't need to alter much code for reading and writing. If you continue reading the link I posted above, it also covers using NeDB within an Electron app.

There are also several other options available that can embed with Electron like NeDB (Pouch, Loki.js) that might suit your needs better.


** UPDATE **

You may be able to use this: https://github.com/nosqlclient/nosqlclient-electron

More info available on the website: https://www.nosqlclient.com/

It looks like it's a replacement application for Electron entirely with MongoDB support, using Electron?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!