How to use minimongo - 8 common examples

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) => {
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;
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 mathew-kurian / Scribe.js / asr / viewer / libs / MongoDB.js View on Github external
return new Promise((resolve, reject) => {
      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;
github mathew-kurian / Scribe.js / asr / viewer / libs / MongoDB.js View on Github external
constructor(url = 'rest/db/', namespace = 'scribe', client = 'webapp') {
    this.url = url;
    this.namespace = namespace;
    this.client = client;

    this.remoteDb = new minimongo.RemoteDb(url, client, JQueryHttpClient);
  }
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);
    });

minimongo

Client-side mongo database with server sync over http

LGPL-3.0
Latest version published 2 months ago

Package Health Score

66 / 100
Full package analysis