How to use the pouchdb-browser.default function in pouchdb-browser

To help you get started, we’ve selected a few pouchdb-browser 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 abahmed / Deer / app / utils / db.js View on Github external
/** @module db */
const PouchDB = require('pouchdb-browser').default
const uuidv4 = require('uuid/v4')

/** Initialize Schema */
const notesDB = new PouchDB('notes')
const noteBooksDB = new PouchDB('notebooks')

/**
 * Fetches all notes from database
 * @return {Promise} of the result
 * */
const fetchNotes = function () {
  return notesDB.allDocs({ include_docs: true })
}

/**
 * Adds / Updates a note to database.
 * @param {string} id for the note
 * @param {string} title for the note
 * @param {string} content for the note
 * @param {string} modified date for the note
github abahmed / Deer / app / utils / db.js View on Github external
/** @module db */
const PouchDB = require('pouchdb-browser').default
const uuidv4 = require('uuid/v4')

/** Initialize Schema */
const notesDB = new PouchDB('notes')
const noteBooksDB = new PouchDB('notebooks')

/**
 * Fetches all notes from database
 * @return {Promise} of the result
 * */
const fetchNotes = function () {
  return notesDB.allDocs({ include_docs: true })
}

/**
 * Adds / Updates a note to database.
 * @param {string} id for the note
 * @param {string} title for the note
 * @param {string} content for the note
 * @param {string} modified date for the note
 * @param {string} rev used in case of updating existing note