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
23
votes
2 answers

What (in_memory) graph DB if modeling data is focused

I am out of ideas and hope to get some useful input. I am using this question to compress my experiences and share them, hoping to inspire some distributors to go the next step with modeling graph databases as a first class question/way. I've been…
Danny
  • 1,078
  • 7
  • 22
8
votes
2 answers

How to reload Loki database and collection from persistence

[UPDATE] I laterly found out some example which is like: this.db = new Loki("viewsaving", { autosave: true, autosaveInterval: 5000, autoload: true, autoloadCallback: function(){ …
Kuan
  • 11,149
  • 23
  • 93
  • 201
6
votes
1 answer

Are Lokijs ID's Unique?

Are lokijs id's ($loki) unique? if I have 2 documents from one collection with $loki:1 and $loki:2 as id's, and I delete $loki:1, the next one I create should it be $loki:3 ???
Pedro Luz
  • 2,694
  • 4
  • 44
  • 54
5
votes
2 answers

in-memory DB (lokiJS) vs regular indexedDB

I was looking for a wrapper library for indexedDB that can store data. (Specific use is for a JavaScript cordova app but one that can also work in the browser) I have found LokiJS which seems feasible. However, LokiJS says it's an: In-memory…
mesqueeb
  • 5,277
  • 5
  • 44
  • 77
5
votes
1 answer

How to delete a Collection in LokiJS

I been working on LokiJS on Node recently, And I could'nt find a command that deletes the entire Collection itself, I tried with these commands with an assumption it would exist, I could not find any docs/ samples to delete a collection. // let…
Mahesh Kumaran
  • 887
  • 2
  • 12
  • 30
5
votes
0 answers

Why does LokiSFSAdapter work on Linux, but not on Windows?

TL;DR A piece of Javascript code works flawlessly on Linux whilst behaving inconsistently on Windows. I am coding an Electron app, using Vue.js for frontend, Vuex for data management and LokiJS for persistence storage (with its File System adapter…
sjaustirni
  • 3,056
  • 7
  • 32
  • 50
5
votes
0 answers

How to sync Lokijs local database with remote database

i decided to use Lokijs in my angular app but i don't know how to sync local database with remote. should i use loki custom adapters or it's changeApi? which is more convenient? some sample code would be appreciated
Mhs.Malekan
  • 114
  • 4
5
votes
2 answers

Loki.js lost data in Ionic Apps

I am developing an Ionic app using loki.js, but every time it refresh the app press f5 i loss all data stored in loki database. Why it happen? I using no chache in my ionic app.
SAMUEL OSPINA
  • 321
  • 2
  • 9
5
votes
1 answer

LokiJS: How to create index (or UniqueIndex) on nested document properties

To create an index (or UniqueIndex) on a LokiJS collection you just need to specify the field name: db.addCollection('Children',{indices:['name']}) ...will create an index on 'name' property of documents in the collection. That's ok for simple…
rov66
  • 53
  • 1
  • 2
5
votes
0 answers

Onsen UI + LokiJS: loki is not defined?

According to LokiJS: in-memory NoSQL datastore for Cordova apps I embedded loki-angular.js and then write the following script: var onsen = angular.module('app', ['onsen', 'lokijs']) .config(['$httpProvider', function($httpProvider) { }]); After…
fmchan
  • 760
  • 1
  • 11
  • 29
4
votes
1 answer

Large database with Lokijs on Mobile App

Recently I come across with lokijs and I am planning to use it for my hybrid mobile app developed using Ionic. From my understanding, it is an in-memory database that will executes very fast. So, my questions is, will it work great with big database…
user1995781
  • 19,085
  • 45
  • 135
  • 236
4
votes
2 answers

LokiJS: Simple find query returns wrong result

In LokiJS I try a very simple query (which I assume is AND): var dbRes = recsCol.find({'format':format, 'cardId':-1}); after inserting some data with recsCol.insert({format:format, cardId:id, recCardId:key, amount:item[key]}); that doesn't contain…
Wonko
  • 176
  • 1
  • 9
4
votes
2 answers

LokiJS with cordova

I am currently working on an app by using Onsen UI+Cordova and trying to use LokiJS as my server-less database. As per LokiJS's documents: If nothing is specified, Loki tries default methods (fs in Node, localStorage in browser and…
Jerell Fox
  • 43
  • 1
  • 4
3
votes
1 answer

How do I query nested object by property inside an array?

I have a collection of several thousand (potentially 30-40k) documents, with a structure (greatly simplified) like this: { propA:'123', obj: [ {prop1:'a'}, {prop1:'b'}, {prop1:'c'} ], propB:456 } How can I query to find all…
TimTheEnchanter
  • 3,370
  • 1
  • 26
  • 47
3
votes
1 answer

Updating Vuex state changes LokiJS data, too. Why? Vuex / LokiJS

My app workflow is getting some data from API backend, and write to client storage with help of LokiJS. I have thousands of data in client collections. For my app's state management I use Vuex. And here is the problem. When I commit changes to my…
mervasdayi
  • 729
  • 6
  • 16
1
2 3 4 5 6 7 8