Questions tagged [nedb]

Embedded persistent database for Node.js, written in Javascript, with no dependency (except npm modules of course). You can think of it as a SQLite for Node.js projects, which can be used with a simple `require` statement. The API is a subset of MongoDB's. You can use it as a persistent or an in-memory only datastore.

About

NeDB is not intended to be a replacement of large-scale databases such as MongoDB! Its goal is to provide you with a clean and easy way to query data and persist it to disk, for web applications that do not need lots of concurrent connections, for example a continuous integration and deployment server and desktop applications built with Node Webkit or Electron.

Links

195 questions
1
vote
1 answer

How to pass data from one page to another by onclick with node.js and express?

app.js const database = new Datastore('database.db'); database.loadDatabase(); app.get('/api', (request, response) => { database.find({},(err,data)=> { if(err){ response.end(); return; } …
1
vote
1 answer

nedb - Create databases dynamically

I have two Temp. Sensors on my Raspberry Pi and I have a node.js Express app. I want to create nedb databases dynamically of an array with sensor objects. So I have an object with sensors in it: sensors: [ { name: "Indoor", type:…
skuettel
  • 13
  • 2
1
vote
0 answers

Not loop over app.post with app.get in node.js

When I am trying to loop over app.get with app.post it is only working once. After that data not clear or changed. How to fixed that. I am trying to get user input data and return data from the Nodejs database according to user input data. I also…
user14554230
1
vote
1 answer

NEDB NodeJS find document and wait for the result

I am using NEDB for some local storage in an NodeJS Application. Therefore I do have an handlerscript "nedbhandler.js" which I do require in my main.js. var NEDB = require('./nedbhandler.js'); async function test(){ var value = await…
Matthias
  • 485
  • 7
  • 21
1
vote
1 answer

NodeJS wait for an axios+nedb function async/await to run next query

I want to use Axios + nedb in a NodeJS Script to gather data from an API into a local file. This is what I done so far: var axios = require('axios'); var Datastore = require('nedb'); const fs = require('fs'); db = new Datastore({ filename:…
Matthias
  • 485
  • 7
  • 21
1
vote
0 answers

web worker - fetch data and store them into browser extension db

I want to use a web worker to speed up some images and data fetch operations. I've created the worker and it's working as expected but I have a problem in my browser extension background file. I've implemented nedb-promises to store the data after…
fed3vt
  • 279
  • 1
  • 4
  • 16
1
vote
1 answer

How to sum the differences between each pair, then sum each pair's results using nedb

I have a nedb database trades.json where I am writing imaginary stock…
Dshiz
  • 3,099
  • 3
  • 26
  • 53
1
vote
0 answers

Save linked images in an app inside the cache using service worker or in database using nedb

I want to save the images that are provided by a JSON response from an api service. At the moment the user have the ability to deiplay them and to save them on the pc. What I want to do is to store the image inside an internal database of my app…
nukiko12
  • 129
  • 1
  • 1
  • 10
1
vote
0 answers

neDB database only loads on full restart Electron

So I switched from working on a mac to working on windows and this weird bug popped up. I have a database(Compendium) and on render of a React component I fire React.useEffect to call a function to pull out some information out of the database. Here…
1
vote
0 answers

Why does inserting a highscore into my database cause the entire client.js not to work?

So I see questions where people are saying they can't insert things into their database. My problem is worse than that: when I try to insert things into my database, none of my client side JavaScript works! I know this because the canvas is set,…
1
vote
1 answer

How to sort NeDB database in get response? (Javascript callback/arrow function syntax confusion)

I have an express server and a simple NeDB database. I can successfully get the whole database like so: app.get('/api', (request, response) => { //queuery the database for everything db .find({}, (error, data) => { if (error) { …
nonethewiser
  • 550
  • 1
  • 6
  • 18
1
vote
0 answers

When I update one value of a users object, all other values are deleted in database. What can I do about this?

I am working on a school project with a team of developers. We have created a page where the users have a profile and that profile can be updated. We have come across a bug when a user updates its information. If I update my city for example, then…
hawe
  • 15
  • 5
1
vote
1 answer

How do I auto delete all records/rows that are older than a week in NodeJs?

I have a requirement where i only need to keep all the data that are not older than 7 days. All the data older that should be auto deleted from the database. I want to do this in NodeJs in ExpressJs server. I have read that i can use setInterval()…
Zeeshan
  • 55
  • 2
  • 11
1
vote
0 answers

how to store javascript object as custom class

I had a custom class, that defined in Javascript. I created an object based on the class and stored inside JSON database. When I retrieved the object, the prototype becomes object constructor, instead of custom class. I changed it by assign a custom…
Abel
  • 1,494
  • 3
  • 21
  • 32
1
vote
1 answer

How do I get result by 'return' from NeDB in vue.js

I am trying to get a data from NeDB in a method in a .vue file using electron-vue. I know I can get that by putting that to a variable, but I want to get that by 'return' because I want to use the result in v-for. I tried to use bluebird promisify…
user4565857
  • 155
  • 1
  • 2
  • 9