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
2
votes
1 answer

How much of load can LokiJs handle

I am planning to use lokijs with a node server. I am not sure how much of the load can it handle in coparison with mongodb? I would like to know how smooth can it run with 100000 documents in it? Thanks Vasanth
vasanth.v
  • 235
  • 3
  • 14
2
votes
1 answer

Unable to loadDatabase with lokiJs

I have trying to create a database with a collection added to this database and the changes saved to a IndexedDB. Below is my code Two controllers SaveController and LoadController. myApp.controller('SaveController', ['$scope', 'Loki', function…
user581157
  • 1,327
  • 4
  • 26
  • 64
2
votes
1 answer

How can I get a nested object within lokijs Collection

I'm using lokijs to store some data that I will need to work with. My data is shown below. As a newbie to lokijs I've been struggling to find a way to get item_part_option_groupsarray out of part. My code partDb = new loki('part.json'); …
Chol Nhial
  • 1,327
  • 1
  • 10
  • 25
2
votes
2 answers

LokiJS: insert existing value for index doesn't error - how to make unique indices?

if I try to override an existing indexed field, I do not get an error. It should error, because it is not update()! var loki = require('lokijs'); var db = new loki('test.json'); var users = db.addCollection('users', { indices:…
Danny
  • 1,078
  • 7
  • 22
2
votes
1 answer

browser app unable to access loki.js

I'm trying to use loki.js in a browser app. I included the following script in the HTML However the following js code gave me "unexpected token" error db = new loki('test');
user1860288
  • 512
  • 2
  • 6
  • 18
2
votes
1 answer

Find by number index

I try to find entries by indices: var questions = db.addCollection('questions',{indices: ['key']}); questions.insert({ key: 1, quest: 'any idea' }, { key: 2, quest: 'no idea' }); questions.find({'key':1}); but I get no result. Dumping the…
user3984802
1
vote
0 answers

How to configure visual regression testing using Loki for Angular and Web components in Storybook

We have a design system with the core components built on Stencil and cross-compiled across React and Angular frameworks. Ideally we have all the components in React, Angular and Web-components. We use storybook as Component explorer. Now that we…
1
vote
0 answers

LokiJS - fastest way to update large number of records?

I have a large in-memory dataset on the client side, and need to quickly update records in a wide dataset (at most, about 50k records at a time). Right now, I have a loop that looks like this. // looping over new data entry, then either updating or…
Kyouma
  • 320
  • 6
  • 14
1
vote
1 answer

Accessing local storage, Migrating Cordova App to Swift App

We’re at the tail end of re-writing a legacy Cordova app completely in a new Swift app, the issue we’re facing is when it comes to migration, the Cordova app stores some information on device like refresh tokens and when we force upgrade our users…
Evan
  • 101
  • 7
1
vote
1 answer

LokiJS saveDatabase to persistence issue

I've been working with lokijs on node and use it with express and socket and typescript. Now i've got two instances of loki database and when I use db.saveDatabase() it is not set in the file although I did initialize with new…
1
vote
1 answer

How to write a case-insensitive query for nuxt-content

I'm writing my blog with Nuxt Content which can filter posts based on their properties. One of my properties is tags. Now I would like to create a page for each tag. My current solution works, but the query is case-sensitive, where I would really…
Johan Vergeer
  • 5,208
  • 10
  • 48
  • 105
1
vote
1 answer

Node-LokiJS: not all get requests are fulfilled, request status is forever pending?

I followed this tutorial on file upload with multer-express and then retrieving image by id Scoth.io. The setup uses LokiJS as database. All the API's works fine however when API to retrieve multiple images by ID isn't working for multiple images.…
appu
  • 471
  • 1
  • 8
  • 26
1
vote
1 answer

LokiJS inconsistent with updates & reads while working with 50k+ reads and writes

Currently we are working with nodeJS & LokiJS. as our application is dealing with real-time data; to communicate with external NoSQL/Relational DB will cause the latency problems. So we decided to use in-memory database i.e, LokiJS. LokiJs is good…
Ram Kowsu
  • 711
  • 2
  • 10
  • 30
1
vote
2 answers

Trying to update LokiJS db but getting 'Trying to update unsynced document' error

Trying to dynamically add entries of people and fruit that they own in Loki JS but I keep getting the Trying to update unsynced document. Please save the document first by using insert() or addMany() error. Anyone have any ideas of how to do this…
RL1234
  • 11
  • 3
1
vote
1 answer

Cannot save data in a file with lokijs

I try a very very basic sample of lokijs with the autosave option, but I cannot save the data... An idea of my mistake ? (it's an adaptation of a sample found on https://github.com/techfort/LokiJS/wiki/LokiJS-persistence-and-adapters I use Node…
Didier68
  • 1,027
  • 12
  • 26