这是用于MongoDB管理的电子应用程序,您可以检查代码作为如何使用mongodb和electronic的示例。
https://github.com/zh_CN/mongotron
基本上,您可以像在Main进程中通常在node.js中使用的那样使用mongodb ,然后通过
ipc 模块与Renderer进程进行通信。
例如:
渲染程序
<html> <head></head> <body> <script> const ipc = require('electron').ipcRenderer; const informationBtn = document.getElementById('information-dialog') informationBtn.addEventListener('click', function (event) { ipc.send('create-user') }) </script> </body><html>主要过程
const ipc = require('electron').ipcMainconst mongo = require('some-mongo-module')ipc.on('create-user', function (event) { })我建议您使用可以在http://electron.atom.io/中找到的入门应用程序



