How to use the lokijs/src/loki-indexed-adapter function in lokijs

To help you get started, we’ve selected a few lokijs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github virtool / virtool / client / src / js / dispatcher / database.js View on Github external
return new Promise ((resolve, reject) => {

            this.lokiAdapter = new LokiIndexedAdapter(`virtool-${dispatcher.settings.get("server_id")}`);

            window.lokiAdapter = this.lokiAdapter;

            this.loki = new Loki(null, {
                env: "BROWSER",
                autosave: true,
                adapter: this.lokiAdapter
            });

            this.loki.loadDatabase({}, (err) => {
                if (err) {
                    reject();
                } else {
                    forIn(DEFINITIONS, (definition, collectionName) => {
                        let collection = this.loki.getCollection(collectionName);