lokijs

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

徘徊边缘 提交于 2019-12-12 17:20:26
问题 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 documents where obj.prop1==='b' ? I can't seem to figure out how to check a property of an object inside an array property. This is using version 1.5.1. Thanks! Update I've done some digging into MongoDB style queries (which I believe Loki emulates?). The following works

how to use lokijs-cordova-fs-adapter in ionic 2

两盒软妹~` 提交于 2019-12-06 11:34:44
问题 I am trying to use lokijs in my ionic 2 app. i am able to use lokijs.js. when trying to persist using adapter i am not able to. i ready lokijs-cordova-fs-adapter can be used. but when i refer it in my app as below: getting an error that its not able to locate. var LokiCordovaFSAdapter = require("./cordova-file-system-adapter"); tried adding it in my index.html and tried creating adapter in my ts file as below: var adapter = new LokiCordovaFSAdapter({"prefix": "loki"}); getting syntax error in

how to use lokijs-cordova-fs-adapter in ionic 2

◇◆丶佛笑我妖孽 提交于 2019-12-04 16:47:30
I am trying to use lokijs in my ionic 2 app. i am able to use lokijs.js. when trying to persist using adapter i am not able to. i ready lokijs-cordova-fs-adapter can be used. but when i refer it in my app as below: getting an error that its not able to locate. var LokiCordovaFSAdapter = require("./cordova-file-system-adapter"); tried adding it in my index.html and tried creating adapter in my ts file as below: var adapter = new LokiCordovaFSAdapter({"prefix": "loki"}); getting syntax error in this case. can someone give an example on how to use it? Ciao, this works on Ionic 2, so step-by-step