0

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 https://rawgit.com/techfort/LokiJS/master/jsdoc/Collection.html we can insert object or array.

But either of them are not passing the values to the loki DB created.

How to solve this?

Hari Kishan
  • 73
  • 3
  • 9

1 Answers1

0

A sample code would be useful but if you can't insert an object (and you're loading the db from an existing file) then it sounds as if you're trying to access the collection from outside the loadDatabase callback. LokiJS supports bulk inserts by passing an array of objects.

Joe Minichino
  • 2,793
  • 20
  • 20