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

LokiJS vs Standard Javascript Object Access

How does LokiJS compare in regards to standard javascript object access by key? var obj = {}; for (var i = 0; i < 10000; i++) { obj[i] = { name: 'name', description: 'desc', misc: 'misc' }; lokicollection.insert({ id: i, name: 'name',…
wayofthefuture
  • 8,339
  • 7
  • 36
  • 53
1
vote
1 answer

Regarding Hybrid Application Development

I have built an android application on ionic . At the backend I'm using node, express, socketIO & MongoDB... I have purchased an Ubuntu base server and installed pm2 and started mongodb and node... Everything is working perfectly well. My Question…
Aniket
  • 93
  • 10
1
vote
0 answers

Lokijs: result.where is not a function

I am using lokijs to create a database, db represents the database of lokijs in the code below: var users; db.loadDatabase({},function(){ users=db.getCollection('users'); }); var result=users.find({'city':{'$contains':searCon.username}}); var…
faryang
  • 55
  • 6
1
vote
0 answers

LokiJs - Error LoadDatabase in Ionic Framework App

I need help, i have build an app with Ionic Framework (in Visual Studio 2015). Now, i have a problem with LoadDatabase in Ripple.js (emulator android in NexusGalaxy). I'm inspired to guide:…
1
vote
2 answers

How to use old database in lokijs?

I am using framework7 with lokijs. To use lokijs database, i need to create new database everytime with new loki(dbname) how do i create a database on my first run and from next runs just load that database ?
1
vote
1 answer

Find distinct value using LokiJS?

Is there any way to find distinct value like using mongo command db.collection.distinct() using lokiJS
Nisanth Sojan
  • 1,099
  • 8
  • 21
1
vote
2 answers

update value not working

I'm trying to perform update on a value but ,the new value that am assigning to it bound to scope value but does not change ,when I edit ,it save with the original empty value breakdown $scope.showDepositUpdate = function(birthday) { …
1
vote
0 answers

Lokijs, module.exports existing collections

is it possible to load existing database(maybe synchronously) and export collection from it? i.e. lokijs_data.js var loki = require('lokijs'); var testDb = new loki('test-db.json', { autosave: true, autoload: true…
shkipper
  • 1,403
  • 3
  • 21
  • 35
1
vote
1 answer

Update from the Html View triggers update to the Dynamic View where in saving it to the LocalStorage loki js

I have a a angular factory class User which gets instantialted via a dynamic view filling in data from the view to the user variable which is then bound to the view. I need to update the localstorage when ever there is a change to the userView.Name…
user581157
  • 1,327
  • 4
  • 26
  • 64
0
votes
0 answers

nextjs, watermelonDb TypeError: LokiWebWorker is not a constructor

I am creating a nextjs chat app with watermelonDb as the offline db on the client side. I am new to nextjs. I am getting this error when I have useWebWorker: true in the adapter instantiation. When I have the useWebWorker:false everything works…
0
votes
0 answers

screenshot testing falles in input test(loki)

Screenshot tests always falling in tests with my custom Input component. Screenshots with difference shows me difference in border-radius even after adding these tests. Sometimes it falls in different places with input but always trouble in…
DmoJK
  • 13
  • 2
0
votes
1 answer

$gte / $lte filters not working in lokijs

I am generating query based on user input and passing it onto LokiJS to handle. However, query doesn't seem to take effect (everything is returned as it is). Logic to generate query :- function prepareQueryFromOptions(options:…
Aman Desai
  • 233
  • 2
  • 11
0
votes
0 answers

NodeJS - best practices to handle in-memory data?

I'm building an app that heavily relies on in-memory data. It listens to 3rd party app via WebSockets and keeps up the in-memory state. I have been thinking libraries like redux would be a great choice, even tho it is built for the…
Cecily Miller
  • 370
  • 2
  • 22
0
votes
0 answers

Drop TimeStamp in Grafana Loki and Get the List of Logs

Recently, i have started working on Grafana Loki. I got some understanding of the logging stack(PLG - Promtail, Loki and Grafana). I need to store the logs in Loki. So, i have set the promtail agents which could monitor the logs file and sends it to…
Waseem
  • 69
  • 11
0
votes
1 answer

TypeError: Loki is not a constructor

I don't seem to be able to figure out why this is not working My Hapi.js index.ts looks like this: import { Server, Request, ResponseToolkit } from '@hapi/hapi'; import * as Loki from 'lokijs'; ... const db = new Loki(`${UPLOAD_PATH}/${DB_NAME}`, {…
Fi Li Ppo
  • 107
  • 11