I am using NeDB in my Electron Application with React.js to store some tasks and projects persistently. I am initializing two DataStores in a file called Database.js
.
this.taskCollection = new Datastore({
filename:'./tasks.json',
autoload: true,
timestampData: true,
});
this.projectCollection = new Datastore({
filename:'./projects.json',
autoload: true,
timestampData: true,
});
Then I am importing the file in my React-App. This happens in the renderer process of Electron. I used the filename property to force NeDB to create a two local file called tasks.json
and projects.json
. Assuming the docs of NeDB this should create the two mentioned files in the current directory, but they are not created. NeDB is only creating IndexedDB datastores and I really do not know why this is the case. Does anyone have a suggestion why this is the case ?
Thanks in advance :)
Edit
When I create the datastores in the main process the files are created. Could it be, that I do not have access to the file System in the renderer process?