How to use the minimongo.IndexedDb function in minimongo

To help you get started, we’ve selected a few minimongo 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 Baqend / js-sdk / webworker / service-worker.js View on Github external
var minimongo = require('minimongo');
var IndexedDb = minimongo.IndexedDb;
var db = new IndexedDb({namespace: "baqend"}, () => {
});
var className;

var CACHE_NAME = 'trillo-v1';
var PREFIX = location.origin;
var REFRESH = 60000; // Bloom filter refresh rate

var bloomFilter;
var bloomFilterReady = false;

self.addEventListener('install', event => {
    // Bypass the waiting lifecycle stage,
    // just in case there's an older version of this SW registration.
    event.waitUntil(self.skipWaiting());
});
github mathew-kurian / Scribe.js / asr / viewer / libs / MongoDB.js View on Github external
new minimongo.MemoryDb({namespace: this.namespace}, localDb => {
        const hybridDb = new minimongo.HybridDb(localDb, this.remoteDb);

        let type;
        if (localDb instanceof minimongo.IndexedDb) {
          type = 'IndexedDb';
        } else if (localDb instanceof minimongo.LocalStorageDb) {
          type = 'LocalStorageDb';
        } else if (localDb instanceof minimongo.MemoryDb) {
          type = 'MemoryDb';
        } else if (localDb instanceof minimongo.WebSQLDb) {
          type = 'WebSQLDb';
        } else {
          throw new Error('Can\'t identify db');
        }

        this.hybridDb = hybridDb;

        resolve(hybridDb, type)
      }, reject);
    });
github Baqend / js-sdk / lib / offline / OfflineService.js View on Github external
'use strict';
const Observable = require('../observable');
const message = require('../message');
const Message = require('../connector/Message');
const StatusCode = Message.StatusCode;

const minimongo = require('minimongo');
const IndexedDb = minimongo.IndexedDb;

let savedObjectsCollection = 'savedObjectsCollection';
let deletedObjectsCollection = 'deletedObjectsCollection';

/**
 * @alias OfflineService
 */
class OfflineService {
    /**
     * @param {EntityManager} entityManager The EntityManager which of this offlineService instance
     */
    constructor(entityManager) {
        this.entityManager = entityManager;
        this.entityManagerFactory = entityManager.entityManagerFactory;

        this.online = new Observable((observer) => {

minimongo

Client-side mongo database with server sync over http

LGPL-3.0
Latest version published 3 months ago

Package Health Score

69 / 100
Full package analysis