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
0
votes
0 answers

Suspected Javascript Async issue with for loop

I have a pretty simple node script which parses a json file from an external url. I'm attempting to have the script loop over each record returned and make a decision to add it to the DB (using nedb) if we haven't previously got it. At the moment my…
Colm Troy
  • 1,947
  • 3
  • 22
  • 35
0
votes
0 answers

Promise not resolved in karma when testing a service

I have a service 'dbService' written in angular. devlog.service('dbService', ['$q', function($q) { this.getLogs = function() { var deferred = $q.defer(); db.find({}, function(err, docs) { if(!err) { …
Dineshs91
  • 2,044
  • 1
  • 25
  • 24
0
votes
1 answer

Can't update elements which are inside the array

Let's say I have this userinfo={ userDetails: { username:"", password:"", cookie:"", firstname:"", lastname:"", phonenumber:"", postalcode:"", country:"" }, …
GPrathap
  • 7,336
  • 7
  • 65
  • 83
0
votes
1 answer

Failed to convert NeDB Node callback to Bacon EventStream

Below the Node callback on NeDB worked correctly, Datastore = require 'nedb' db = new Datastore db.insert a: 'Hi!', (err, docs) -> console.log docs Then tried to convert NeDB Node callback to Bacon EventStream, Bacon =…
sof
  • 9,113
  • 16
  • 57
  • 83
0
votes
1 answer

How to create database within nodejs application code in node-webkit?

I'm trying to use NeDB database for persistence of application data. I'm trying to use the following approach to connect to my database like the following: var Datastore = require('nedb') , path = require('path') , db = new Datastore({ filename:…
Erik
  • 14,060
  • 49
  • 132
  • 218
0
votes
1 answer

Update only works sometimes

When trying to update data in a NeDB database I'm getting Field names cannot begin with the $ character however it only happens after the second or third time updating the DB. Here's the code I'm using to update/insert data: addNew: function(data)…
0
votes
2 answers

How do I use Sails.js in Node-Webkit?

I tried to create an application with Node-Webkit and Sails.js. My API works fine, I get the JSON I need, but when integrated with Node-Webkit does not start the server. My package.json contains: {    "name": "app-sails"    "main":…
-1
votes
1 answer

Returning undefined when i tried to return db search result

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 return undefined, i tried to change it to async, but it…
Antonio
  • 299
  • 1
  • 4
  • 13
-1
votes
1 answer

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: true }); database.loadDatabase(); const App = () => { return…
SupEldrix
  • 103
  • 1
  • 8
-1
votes
1 answer

Nedb async function to be awaited

async function count() { let nedb = <> let count = 0 await iterate(nedb, {}, g=>{ count++ }) console.log(count) iterate(xx, query, callback) { return new…
m23
  • 91
  • 1
  • 3
-1
votes
2 answers

Is it possible to insert a whole .json file in a database NeDB?

I was wondering if it was possible to insert a whole json file in a NeDB database . I'm trying to turn an .xlsx file to a .json file, I succeed but I'm wondering if it's possible to insert the whole .json file in a NeDB database
Tewan
  • 171
  • 1
  • 12
-1
votes
1 answer

Replacement for NeDB for consistant, replicated persistent node.js data storage

I have a node.js server application that stores it's data (small, as in "few kb") in NeDB. I need to have more than one instance with synchronized data. As NeDB was not designed to handle replication I need an alternative persistent data storage.…
Koder
  • 454
  • 5
  • 13
-1
votes
1 answer

NeDB didn't update the records

Hi I don't know why this function didn't do anything, even don't show anything on the console, and the callback function didn't work , Sorry if I made an obvious mistake I'm new with node js and NeDb. here is my update function: var Datastore =…
efirvida
  • 4,592
  • 3
  • 42
  • 68
-2
votes
1 answer

How to print only the requested part of a database?

I want to print out only the countries name and their population. I have assorted them in ascending order and would like to print out only their names and populations in that order. When I try to do that I get "undefined". When I print my function,…
John Doee
  • 207
  • 4
  • 15
-2
votes
1 answer

why value is undefined in node which is returned by database

I am learning nedb and Node.js Here is the database.js file: // Initialize the database var Datastore = require('nedb'); db = new Datastore({ filename: 'db/persons.db', autoload: true }); //Returns a specific Person exports.getPerson =…
Vishal
  • 6,238
  • 10
  • 82
  • 158
1 2 3
12
13