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.

nedb
Filter by
Sorted by
Tagged with
0 votes
0 answers
25 views

updating doc in NeDB making duplicates docs

I am writing a game website and I am trying to use NeDB to store variables to an account and instead of updating the variables in the document it makes duplicates of the document with the same ID. ...
Cambrian Granzeier's user avatar
0 votes
0 answers
23 views

NeDB database is not loading

Can you explain the reasons of error while loading database& Here is a code of an electron application function startDB(_win, _path) { const db = {}; const dictStructureList = [ .....
Mikhail Philippov's user avatar
0 votes
0 answers
33 views

How much can NEDB with expressjs handle? Will it be suitable for this?

I'm using react and nodejs with express to create a simple site. I'm relatively familiar with nedb as a super lightweight database as it is a lot simpler and easier to set up. I'm only expecting ...
Toby Langdon's user avatar
0 votes
0 answers
28 views

Update Object Value In Array In NeDB

I am looking for some help as to how to update a specific object value within an array using NeDB. I am creating a Node.js web app that needs to use NeDB as it's database. Not sure if you need this ...
cd1189's user avatar
  • 1
0 votes
2 answers
39 views

how can I use object outside of a function in Nodejs

I'm Using NodeJs , why I'm not able to get the value of the data in collection variable here I'm using Nedb router.get('/', (req, res) => { var collection = []; db.find({}, function (err, ...
aditya tyagi's user avatar
0 votes
1 answer
88 views

Javascript API is not inserting to NeDB, but it is returning the data to the client without error

I'm building a web application to track scores for a game, but I have run into an issue when trying to save the score entries to the db. I'm using Node JS and NeDB. The client requests the post API ...
T Jones's user avatar
  • 11
0 votes
1 answer
157 views

how do i pass a variable into search query of Nedb

i want to run a search function from the search bar of the website homepage that will query the **nedb ** database with the result gotten from **searchtext ** variable. How do i pass the searchtext ...
Nsikan Simon's user avatar
1 vote
0 answers
138 views

Electron nedb-promises storage file gets replaced on every app start

I'm now trying for a few hours to understand why this happens, in my electron app i would like to use the nedb-promises package("nedb-promises": "^6.2.1",). Installation and ...
Marco's user avatar
  • 493
0 votes
1 answer
76 views

How do I store data into nedb on multiple lines?

I would like to store each element of the array into separate lines when storing it into NEDB database. Basically using some kind of "\r\n", after every element, as following: I am basically ...
JoJo's user avatar
  • 1
1 vote
1 answer
232 views

How can I import NeDB as ES Mobule

I need to import NeDB and I need to do this using ES Module, what I need from NeDB is DataStore. When I try to import DataStore using the usual synthax : import { DataStore } from 'nedb'; I have this ...
nem0z's user avatar
  • 1,080
0 votes
1 answer
120 views

Problem extracting data from NEDB database Node.JS

I have a NEDB Datastore called users which contains one line of information. I call a fetch request to retrieve the users from the server and I can tell that the request is being processed by ...
Daniel Zamloot's user avatar
1 vote
1 answer
415 views

Security issues in neb and underscore

this is my first question and I hope I am not coming up with something totally stupid. I am new to JS and Node.js. I can solve easy issues on my own, but with this pollution report I need some advice. ...
Klaus53123's user avatar
0 votes
0 answers
105 views

NeDB ensureIndex isn't working as expected

I'm working on a twitter bot that is supposed to search the twitter api for key words in intervals and log the response in a database. I've so far logged results in a simple JSON but want to move to ...
mohammadalha's user avatar
0 votes
1 answer
153 views

insert into NedB boolean value without quotation marks

I have a NedB database which I'm trying to insert some new data into that I retrieve from HTML form, this is my function to insert new. addEntry(name,desc,ingred,allergy,cat,aval,price){ var ...
Abdelrhmann02's user avatar
0 votes
0 answers
184 views

faile to send file with axios to nedb

hello when i try to send a picture from my client to my nedb server it make him crash i don't know what should i do, please help me when i tried to send directly the file without append it in data ...
chihaz's user avatar
  • 1
0 votes
1 answer
78 views

Use Discord.js/Node.js/NeDB to Remove Role From User After X Number of Hours

I'm relatively new to Javascript and Node, but I have managed to create a bot for my discord server and implement a basic economy, granting points based off of post submissions. These points are ...
Uncle Bojangles's user avatar
0 votes
0 answers
538 views

Http POST request sending more than one request at the time

I am sending an HTTP POST request to insert specific username/password data on a database and for some reason, it works but it sends and registers twice or more times. The HTTP request (instead of one,...
Daniel Dias's user avatar
1 vote
0 answers
198 views

RangeError: Maximum call stack size exceeded. Using nedb database, no recursion

I am using nedb as a database for a small discord bot I have created. Downloaded via npm install nedb --save, and set up in the main file with: const { callbackify } = require('util'); var db = new ...
Atil's user avatar
  • 13
0 votes
3 answers
4k views

Keep getting a DELETE 400 (Bad Request) with my REST API

So, I've created a API and I've got my POST and GET requests working, but I'm can't get the DELETE request to work. I keep getting a 'DELETE http://localhost:3000/api 400 (Bad Request)' error in the ...
firecode85's user avatar
0 votes
1 answer
567 views

How do I store NeDB objects in a collection?

I want to use NeDB as a database for a very simple ExpressJS application. I would like to store collections of objects into a separate file, so one file for orders (orders.json). However, whenever I ...
AbdelHajou's user avatar
0 votes
1 answer
354 views

NEDB & Nodejs: searching for specific record in home.db using user input - unable to pass parameter to index.js

STUDENT WARNING. I am learning to use Nodejs, express with NEDB and database. I am attempting to query my home.db (NeDB) for a specific record, making use of user input (in this case, the name of a ...
VonnScript's user avatar
1 vote
0 answers
107 views

I am trying to display Base64 video, ( AngularJS, NeDB)

Anyone know about how to display Base64 video in angular js. I am trying to display the image in HTML i get this error https://i.stack.imgur.com/lAOvO.png In database storing like https://i.stack....
Gajanan's user avatar
  • 454
0 votes
1 answer
527 views

How to store only certain fields from NeDB database into an array with NodeJS

I have an embedded NeDB database with numerous entries with multiple fields and I'm looking to only get the dates from every entry and store it into an array. I'm using NeDB, NodeJS and express. The ...
giants22's user avatar
0 votes
1 answer
158 views

nodejs - save account information inside .env file or in client side database

I've created a simple nodejs app that will use express to do some file processing operations. I will pack the final app using pkg this mean that the app will access the packaged resources in readonly ...
newbiedev's user avatar
  • 3,061
0 votes
0 answers
33 views

Why do I get nedb error "You cannot mix modifiers and normal fields" on update

I try to update an nedb document using basically the following code: var doc = { "$set": { "freimessen.messungen": [ { &...
elsni's user avatar
  • 2,015
0 votes
1 answer
470 views

NeDB not calling back when using findOne()

I am creating an OAuth 2.0 service for my up-and-coming Alexa skill, and when I'm getting a client from the clients database using NeDB, there's no callback. getClient() module.exports.getClient = ...
IceBotYT's user avatar
0 votes
1 answer
576 views

How do I find documents by name only with NeDB?

I'm trying to find documents by only the document name in NeDB. I have read through the documentation, but all examples also search on a value. I am only inserting one document, and need to query by ...
Dshiz's user avatar
  • 3,231
1 vote
2 answers
501 views

NodeJS nedb function not awaiting

Function checkExists is taking too long to execute. Tried to use await async function but had no effect. var exists = await checkExists(data.email); is returning undefined because not awaiting for ...
Gullen's user avatar
  • 13
0 votes
1 answer
155 views

Tring to get nedb to import in a Svelte component

I have a basic Electron/Svelte app and I'm trying to add database functionality using nedb. If I use let Datastore = require("nedb") I get an error, "Uncaught ReferenceError: require is ...
Kim Aldis's user avatar
  • 693
1 vote
1 answer
1k views

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....
deepak randhawa's user avatar
-1 votes
1 answer
89 views

Returning undefined when i tried to return db search result [duplicate]

I creating electron app with neDB. I want to create function: const getAllHosts = (db) => { db.find({}, (err, hosts) => { return hosts }) } But when i call this function, it ...
Antonio's user avatar
  • 301
1 vote
1 answer
351 views

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: ...
skuettel's user avatar
1 vote
0 answers
191 views

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 ...
user avatar
1 vote
1 answer
910 views

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')...
Matthias's user avatar
  • 495
1 vote
1 answer
479 views

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 = ...
Matthias's user avatar
  • 495
1 vote
0 answers
111 views

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 ...
fed3vt's user avatar
  • 299
1 vote
1 answer
58 views

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 trades: {"buySell":"BUY","currentPrice":431.55,"_id":"GyTaUKVOCa9x5APS"}, {"...
Dshiz's user avatar
  • 3,231
-1 votes
1 answer
860 views

nedb Database not loading file in React Js

Anybody who's knowledgeable using NeDB? import React from "react"; const Datastore = require("nedb"), database = new Datastore({ filename: "./database.db", autoload: ...
SupEldrix's user avatar
  • 103
0 votes
1 answer
204 views

Vue.js dependency injection

In my vue electron project I want to use nedb-promises as a global dependency. I've seen that vuex or i18n plugin will be passed to the construc of the vue indatnce. Will this be possible also with ...
miko's user avatar
  • 129
0 votes
0 answers
184 views

check if timestamp is old than 24 hours - Javascript

I'm using the Date.now() function to get the timestamp when an api call is made. I'm storing it in the database powered by nedb-promises. How I can use it later in the code to check if a new api call ...
miko's user avatar
  • 129
0 votes
0 answers
70 views

Stop execution of a function if a certain condition is met by the nedb findone

I have placed the following code in my function but when a certain condition is met it doesnt stop executing the function how do i fix this? thanks for ur time db.findOne({nickname: args[2]}, (err,...
Antony Thoppil's user avatar
0 votes
1 answer
1k views

Send true or false to database wether checkbox is checked or not

i got an issue regarding checkboxes with nedb. I want to send true or false if the checkbox is checked or not to the database i cannot solve this issue. i am working with node.js and nedb. please help!...
yde13's user avatar
  • 47
1 vote
0 answers
74 views

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 ...
nukiko12's user avatar
  • 139
1 vote
0 answers
227 views

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 ...
Galina Vitvitskaya's user avatar
1 vote
0 answers
54 views

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 ...
Raphael Morgan's user avatar
3 votes
1 answer
238 views

parse NeDB file in golang

everyone! I'm new in programming, so, please, be lenient :) I have a .db file from NeDB that looks like json: {"key":"User","value":{"user":{"userId":&...
rs256's user avatar
  • 69
0 votes
1 answer
325 views

Promise being resolved before the beginning of test

Solution Converting the promises into the promise factory fixes the issue of logs appearing before the test runs. And my promise.all was not resolving because I just assumed that the NeDB database ...
Akshay Kumar's user avatar
0 votes
1 answer
320 views

Nedb Find one item and change another

I am finding a piece of data by searching for the name, however, that person also has a score count, how could I just get the score count. database.find({ username: username }, function(err, doc) { ...
user12541218's user avatar
0 votes
2 answers
47 views

Extract function from javascript promise (expressjs + neDB)

The following code is working and retrieving all users from my neDB-promisses: const getUsers = (res) => { db.find({}) .sort({ name: 1 }) .exec() .then( (content) =&...
Thomas's user avatar
  • 13
2 votes
1 answer
527 views

why my fetch post is not working it is not responding?

addwordform.addEventListener('submit', (event)=>{ event.preventDefault(); const formdata=new FormData(addwordform); const word=formdata.get('addword'); const description =formdata.get(...
Advaith s's user avatar