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

Loki db changes new project integration

My project new integration : I am using find() method but it is not working. var arrayResults = collection.find({'userId':$rootScope.userId,'productType':'kcc'}); Like this working fine. var arrayResults =…
0
votes
1 answer

LokiJS: when using DynamicView().branchResultSet with applySort it doesn't sort the collection

I am having a problem getting data from a branchResultSet after using the applySort on the view. The reason I am using that is because I want a limit of 10 records back and not the whole thing for better performance. When I use only the data method…
Esteban Morales
  • 1,626
  • 14
  • 14
0
votes
1 answer

LokiJS returns null database within module

I am creating a noSQL database for a NodeJS application. I want the database to exist as its own class. However, after moving my database initialization code inside the module it no longer works. LokiJS fails to load the database and I am unable to…
Funky Kong
  • 77
  • 8
0
votes
1 answer

why electron builder dont include files

I try to include lokiJS (locla json database) to my vue-electron app from a vue-cli-plugin-electron-builder!. src/db/db.js const path = require('path') import * as loki from 'lokijs'; const dbPath = path.resolve('src/db/db.json') let db = new…
Vin
  • 143
  • 1
  • 1
  • 7
0
votes
2 answers

Lokijs find is giving incorrect response

Lokijs giving incorrect find response in Node JS environment This is an example taken from online: // This database has already been created for you. // var db = new loki('sandbox'); // Add a collection to the database var items =…
Ram Kowsu
  • 711
  • 2
  • 10
  • 30
0
votes
1 answer

Lokijs remove item by value

I have this small db i have created in loki js var db = new loki('loki.json'); var children = db.addCollection('children'); I have added some items and now i am trying to remove an item by the value. I am storing my values like this var date = new…
Gandalf
  • 1
  • 29
  • 94
  • 165
0
votes
1 answer

Mango query on LokiJs collection changes size of collection

I'm using LokiJs as an in-memory cache for an application that stores data in CouchDB and allows retrieval through a NodeJS server. Per the documentation on constructing queries, the results of my query are assigned to a result set object: let…
0
votes
2 answers

lokijs storing in filesystem not in in-memeory

I tried the following basic example from the online; var loki = require('lokijs'); var lokiDatabase = new loki('oops.json'); var collection = lokiDatabase.addCollection('props',{ indices: ['name'] }); function hello() { var insertjson =…
Ram Kowsu
  • 711
  • 2
  • 10
  • 30
0
votes
1 answer

Does LokiJS supports ISO-8601 date format?

When storing a date in ISO-8601 format (a string), will the date operators ($dteq, $dtgte, $dtlte) work out-of-the-box? Or all my children are cursed by javascript date? Oddhinn Blessadur!
Dimas Crocco
  • 410
  • 6
  • 16
0
votes
1 answer

How i create indices in LokiJS DB?

At the creation time we can directly pass property name but how i create indices in a existing db ? const db = { patent: { disableMeta: true, indices: ['update_time'], unique: ['app_no'], }, }; const _db = new…
linto cheeran
  • 1,440
  • 1
  • 17
  • 30
0
votes
1 answer

How to hardcode / prepopulate LokiJS Database

I'm just starting off with LokiJS and I have one fundamental question I can't wrap my head around: Is there a way to hardcode a LokiJS database? Or do I have do add all the data via Javascript? It seems necessary to me, to have something like…
Eric
  • 39
  • 7
0
votes
1 answer

querying `lokidb` for keys in array that match a pattern

I am playing around with Lokijs to figure out if it will work for me. I have created a db of about 170K records (~500 MB size). The records have (among other keys), the following … authors: [ {name: 'William Shakespeare'}, {name: 'Ed…
punkish
  • 13,598
  • 26
  • 66
  • 101
0
votes
0 answers

Type definition file for @lokijs/loki (v2)?

I realize this is still in beta, but are there typings available? I've got the beta code working, but would love to have a definition file to help me learn. Is there guidance on getting it to work? Thanks!
TimTheEnchanter
  • 3,370
  • 1
  • 26
  • 47
0
votes
1 answer

How to add listener on data change in LokiJS?

I'm trying to add listener to LokiJS such that I get notified whenever there is change in data in any of the collections (though as per documentation LokiJS supports notification of data change). However I'm unable to get notification on data…
Karthik Prasad
  • 9,662
  • 10
  • 64
  • 112
0
votes
0 answers

In LokiJS, Creating multiple Databases or Creating multiple collection with in database, which will have better performance

I am using LokiJS in Node Express Web Application. Use case is as follows For every request on Node JS, I will bring the data from SOLR and insert into LokiJS Database. Create some dynamic views in in-memory LokiJS DB Update records in dynamic…
Amit Dube
  • 947
  • 4
  • 10
  • 23