index.js
function getMainDoc(db) {
  return getDocWithDefault(db, MAIN_DOC_ID, {}).then(function (doc) {
    if (!doc._attachments) {
      doc._attachments = {};
    }
    return doc;
  });
}
function getMainDoc(db) {
  return getDocWithDefault(db, MAIN_DOC_ID, {}).then(function (doc) {
    if (!doc._attachments) {
      doc._attachments = {};
    }
    return doc;
  });
}
function getMainDoc ( db ) { return getDocWithDefault ( db , MAIN_DOC_ID , { } ) . then ( function ( doc ) { if ( ! doc . _attachments ) { doc . _attachments = { } ; } return doc ; } ) ; }
Store all attachments in a single doc. Since attachments
are deduped, and unless the attachment metadata can't all fit
in memory at once, there's no reason not to do this.
Store all attachments in a single doc . Since attachments are deduped and unless the attachment metadata can t all fit in memory at once there s no reason not to do this .