How to use the pouchdb-core function in pouchdb-core

To help you get started, we’ve selected a few pouchdb-core 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 apache / couchdb-fauxton / app / addons / documents / rev-browser / actions.js View on Github external
export const initDiffEditor = (dbName, docId) => dispatch => {
  // We have to use API url here because PouchDB doesn't take relative urls.
  const url = FauxtonAPI.urls('databaseBaseURL', 'apiurl', dbName);
  db = PouchDB(url);

  Promise.all([db.get(docId), getTree(db, docId)])
    .then(([doc, tree]) => {
      const conflictingRevs = getConflictingRevs(tree.paths, tree.winner, Object.keys(tree.deleted));
      const initialRev = conflictingRevs[0];

      if (!initialRev) {
        return dispatch(treeLoaded(tree, doc, conflictingRevs, null, dbName));
      }

      db.get(doc._id, {rev: initialRev})
        .then((conflictDoc) => {
          dispatch(treeLoaded(tree, doc, conflictingRevs, conflictDoc, dbName));
        });
    });
};
github ChainSafe / lodestar / packages / lodestar / src / db / controller / impl / pouch.ts View on Github external
public constructor(opts: IDatabaseOptions) {
    super();
    this.db = new PouchDB(
      opts.name || "lodestar-beaconchain",
      {
        adapter: "memory",
      }
    );
  }
github WebMemex / webmemex-extension / __mocks__ / src / pouchdb.js View on Github external
import PouchDB from 'pouchdb-core'
import PouchDBFind from 'pouchdb-find'

import PouchDBMemory from 'pouchdb-adapter-memory'

PouchDB
  .plugin(PouchDBMemory)
  .plugin(PouchDBFind)

const pouchdbOptions = {
    name: 'testdb',
    auto_compaction: true,
    adapter: 'memory',
}

const db = PouchDB(pouchdbOptions)
export default db

pouchdb-core

The core of PouchDB as a standalone package.

Apache-2.0
Latest version published 1 year ago

Package Health Score

81 / 100
Full package analysis

Similar packages