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

NeDB How can i use variable in find query?

how can i use variable in my find query, something like this: db have docs like {choices:{'04-09-2017':'a'},b:'b'}, {choices:{'04-10-2017':'a'},c:'c'} my query is var x = "choices.04-09-2017" db.find({ x: { $exists: true …
1
vote
1 answer

NEDB Query returning false positives with $nin on array

I'm having an issue using the NEDB find() query structure. The find() query below should return all new messages: sent to the email or the All group specified and that have not been read or sent by the email specified. However, it is returning…
An0nC0d3r
  • 1,275
  • 13
  • 33
1
vote
1 answer

Equivalent of SELECT * in NEDB node.js

I am new on nedb using node.js just wondering how to display all records or SELECT * FROM tablename i know that nedb is completely different from mysql but i need to embed a database inside my electron application, i just need to know if nedb is…
KaoriYui
  • 912
  • 1
  • 13
  • 43
1
vote
0 answers

Export Nedb contents

I have an electron app that acts as a tool to speed up game development. When a user opens the app they can begin importing assets and setting custom properties. I store these properties in nedb. The way I have my application set up, every page…
Dan
  • 1,812
  • 3
  • 13
  • 27
1
vote
0 answers

call variable inside Nedb database in another function

I am working on project using Nedb as database. What i need is to call variable inside database in other function. What i did is to use db.find to get variable from database like this: function findvariable(){ var prob=0; db.find({}, function(err,…
BELLAL
  • 19
  • 4
1
vote
3 answers

MongoDB $elemMatch not working for subdocument

Im trying to get specific quiz in database by id: static getQuiz(db, id, cb){ //db is database connection, id is quiz id, cb is just callback db.find({ _id : "8RA4Rey50eqKFlWK"}, {"quiz" : { $elemMatch : { _id : id}}}, function(err, Doc){ …
tonywei
  • 677
  • 2
  • 12
  • 25
1
vote
0 answers

Electron Packager Not Loading Default Data In My NeDB

I used Electron Packager to build my application which has some initial data in a NeDB. But then the packager generates the db file alright without the data after I ran the .exe file that was created.
user2987773
  • 407
  • 5
  • 18
1
vote
1 answer

How to use nedb api from different modules in nodejs?

I have initialized a database in foo.js and saved some data into it. var Datastore = require('nedb'); var bar = require('./bar.js'); var db = new Datastore({filename: './foo.db', autoload: true}); // saving some data here db.insert(doc, function…
Taufiq Ahmed
  • 700
  • 5
  • 8
1
vote
1 answer

NeDB + Typescript

How can I get a datastore with NeDB using typescrip classes syntax? namespace NamespaceName { "use strict"; export class Persistence { private attrs: Type; public static $inject: Array = []; constructor( ) { …
Abel
  • 355
  • 9
  • 20
1
vote
0 answers

React + Redux + Electron desktop application, how to save data on local files

As the title says I want my react-redux application running with node-electron to save some data when few actions fires. Try 1: So I tried nedb first but it does not actually create any local database file but only does save data in memory and I…
Dishant Chavda
  • 444
  • 4
  • 12
1
vote
2 answers

Updating a particular array element in nedb

In nedb, I have an array field in a document. How will I update an array element at any index? For example, { fruits:['mango','apple','banana'] } I would like to modify the 2nd element and make the array as ['mango','pear','banana']. How to do…
user6579154
1
vote
0 answers

Synchronising subset of mongodb on local machine

I would like to synchronise a subset of a Mongodb onto my local machine which would have a lightweight database like NeDB. What are the methods available to see what is the difference between the data in the two database, so that I could retrieve…
harinsa
  • 3,176
  • 5
  • 33
  • 53
1
vote
1 answer

NeDB query with projection syntax error

I get a syntax on a simple NeDB request. What is wrong with my query written for Feathers/NeDB? var workFilter = { query: { _id: { $nin: workIds} }, { customerId: 1, productId: 1, _id: 1} } Thank you
Moshe Shmukler
  • 1,270
  • 2
  • 21
  • 43
1
vote
1 answer

Error when trying to require browser version of NeDB

I'm developing a client side application and I want to use the browser version of NeDB. Using gulp, I run browserify to create my bundle.js. The problem is when I try to import the browser version of NeDB I face an error about a require inside the…
rcorreia
  • 549
  • 1
  • 9
  • 27
1
vote
2 answers

Update a row in nedb

I have the following data in…
user3202499
  • 87
  • 2
  • 14