Questions tagged [lokijs]

LokiJS is an in-memory JavaScript datastore with persistence.

LokiJS is:

  • In-Browser NoSQL db with syncing and persisting
  • a Redis-style store an npm install away
  • Persistable NoSQL db for Cordova
  • Embeddable NoSQL db with Persistence for node-webkit
106 questions
0
votes
2 answers

NodeJS - How can I stream a response using an in memory DB?

How can I stream a response using an in memory DB? I'm using Loki JS as an in memory DB. There is a particular resource where I must return the entire contents of a table (cannot be paginated) and that table can grow to 500,000 items or so, which is…
mcranston18
  • 4,680
  • 3
  • 36
  • 37
0
votes
1 answer

What is DynamicView in layman's term in LokiJS?

I kind of understand what DynamicView is. However, at the same time, I am confused by what it really means. I know how to use it based on articles I have read such as here. However, what is it?
Kiong
  • 798
  • 1
  • 8
  • 28
0
votes
1 answer

How do I import lokijs in aurelia

I recently installed and imported lokijs in aurelia with jspm : install: jspm install npm:lokijs import: import * as loki from 'lokijs' the problem is when I want to create a db instance using loki, I get an error saying that 'loki is not a…
Jafar Rasooli
  • 3,437
  • 2
  • 14
  • 13
0
votes
0 answers

LokiJS simpleSort issues

I have a need to sort my data based on the property set in LokiJS simpleSort. Its a string data type which contains both numeric & floating point values. Example : var db=new loki('example.db'); var users = db.addCollection('users'); users.insert([{…
DB03
  • 11
  • 5
0
votes
1 answer

Autosaving data using LokiJS and NodeJS

I am facing some difficulty in finding the perfect solution of autosaving data while using LokiJS in NodeJS... I tried something from the official doc, but all it says is that saveDB is not a function. Pls help.
0
votes
1 answer

Save Lokijs DB in Electron

there is some way from inside the "main.js" electron to save a file out of the asar? I'm fighting with this command to point the way out of the write-only area but I can not do it. It would be nice that the path was inside /my-project/resources/…
XaBerr
  • 350
  • 3
  • 19
0
votes
1 answer

Loki js query to database returns nothing

I am trying to use loki js in order to filter the objects whose timestamps are older than current: public getExpiredElements(): any[] { let currentDate = new Date().toISOString(); console.log(currentDate); return…
Jerzy Gruszka
  • 1,629
  • 4
  • 15
  • 20
0
votes
1 answer

Issue calling service inside app.config

Having some problems right now calling a service I created that uses LokiJS (http://lokijs.org/#/) inside of my app.config. I know that in Angular you are not really supposed to attempt to use services inside of the config section during app start…
parchambeau
  • 1,141
  • 9
  • 34
  • 56
0
votes
2 answers

Ionic +LokiJS always produces "ionic.bundle.js:26794 TypeError: Cannot read property 'insert' of undefined"

after all of my problems with SQLite, I wanted to use a different solution for my Ionic app. LokiJS was often mentioned, so I tried it. But also with LokiJS I have no luck. At the moment I have a very basic code, which should work without…
cjs1976
  • 35
  • 2
  • 8
0
votes
1 answer

Loki JS doesn't persist data in Ionic

I'm using LokiJS to save in local storage (well, I'm trying) . What I want to do is a ToDo app, my controller is as follows: .controller('Dash', function($scope) { var db = new loki('loki.json'); $scope.name=""; $scope.lname=""; …
0
votes
1 answer

Insert in loki js not working

I'm working on a Ionic project where I need to store data locally and I'm using Loki js, I created a factory using Loki js and it is initializing and I'm creating the database and while inserting it is not working. According to their documentation…
Hari Kishan
  • 73
  • 3
  • 9
0
votes
1 answer

Dynamically add properties/function to a service/factory

I wrote a small Angular1 app which has a Database service that is using LokiJS. I was wondering if there is a way to dynamically add properties/functions to a Service/Factory. I'm trying to add dynamic getter for every collection that is created via…
kerosene
  • 930
  • 14
  • 31
0
votes
1 answer

LokiJS autoloadCallback not woking

I am trying to use my existing DB in LokiJS but my autoloadCallback does not fire. Am using console.log('from add collection don') to know when it fires but it never does and when I try to add data to the DB it fails. It only works when I set my…
Lawrence Nwoko
  • 79
  • 1
  • 10
0
votes
0 answers

Lokijs DB data removed after rerun using ionic run command?

I am working on a ionic project and trying to use LokiJS. Below is my code, controller, $scope.test ={birthdays:[]}; $ionicPlatform.ready(function() { BirthdayService.initDB(); BirthdayService.getAllBirthdays().then(function(birthdays){ …
Learner_Programmer
  • 1,259
  • 1
  • 13
  • 38
0
votes
1 answer

Reorganize simple app with nodejs and lokijs

It is my first node.js app. I use http://www.nodebeginner.org/ as example and http://lokijs.org/ as in-memory db. So, i have problem with code orgatization. Now it is looks like following: index.js var server = require('./server'); var…
anastsiacrs
  • 159
  • 4
  • 18