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

Finding minimum in Nedb datatable?

I have following data structure in Nedb: ["UserId":"1446844665274","taskDone":"false","id":12,"_id":"1XURfx5uAZpgbh1i"] ["UserId":"1446844665274","taskDone":"false","id":10,"_id":"2I25xNAGTM7Iw2Af"] …
user3202499
  • 87
  • 2
  • 14
1
vote
2 answers

NEDB is clearing content of file when app's relauched

I have written NodeWebKitApp in which I save user's data (like name, uid and settings) for later use. I can insert a document fine and I can see its content. The file size is about 2KB. But, if I close the app and then re-open it, the saved data…
Test Test
  • 145
  • 1
  • 14
1
vote
2 answers

Read variables from a parent function

This is a javascript code from my node-webkit app, working with jquery and nedb for managing the databases. librodb.find({_id: docs[i].libro}, function (err, bookdoc) { window.titulo = bookdoc[0].titulo; window.ISBN = bookdoc[0].ISBN; }); That…
1
vote
2 answers

How ensure default data in NeDB?

I'm trying to use NeDB as storage for my data in node-webkit application. I have the single collection named config.db: var Datastore = require('nedb') , path = require('path') , db = new Datastore({ filename:…
Erik
  • 14,060
  • 49
  • 132
  • 218
1
vote
1 answer

Node.js - Nock and nedb - Reply gets executed before the call back finishes

I'm using nock to intercept calls to my API host and do some local db look-ups before returning the response. Please refer the below code. I intercept calls to 'entrypoint' and would like to reply with the data fetched from local datastore. I…
Ananth
  • 767
  • 1
  • 7
  • 15
1
vote
3 answers

NeDB Update does not work

With NeDB the first statement will update the data correctly, but the second (using the doc value itself as key(and yes docs[i].ID is '2013000060') won't work - even the result of the update function tells me that 1 row was changed. 1. oDB.update({…
0
votes
0 answers

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 between 1000 - 5000 entries into the database and I…
0
votes
0 answers

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 info, but I also have the following dependencies in…
cd1189
  • 1
0
votes
2 answers

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, data) { collection = data }); …
0
votes
0 answers

Geolocation API latitude and longitude return decimal degrees were weatherAPI.com says I'm on the other side of the world

I'm using the geolocation web API to return the latitude and longitude of the user in decimal degrees. I use the following code to accomplish this: const lat = position.coords.latitude + 0.001 const lon = position.coords.longitude - 0.001 const…
Ethan
  • 118
  • 1
  • 13
0
votes
0 answers

How to save images in NedB database and be able to show it in the frontend

I'm working on a recipe website with React and using NedB as the database. For each recipe, I want to store an image that I can retrieve later to be able to show it on the website but can't find any resources online to know how to do it. This is my…
0
votes
1 answer

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 and database.insert(data) does not save to…
T Jones
  • 11
  • 3
0
votes
1 answer

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 variable into the // as a regular expression? to…
Nsikan Simon
  • 47
  • 1
  • 6
0
votes
1 answer

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 doing this, right now usernames =…
JoJo
  • 1
  • 2
0
votes
1 answer

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 error : Named export 'Datastore' not found. The…
nem0z
  • 1,060
  • 1
  • 4
  • 17