Skip to content

Instantly share code, notes, and snippets.

@wmakeev
Created March 23, 2018 08:23
Show Gist options
  • Save wmakeev/d6d37c8f4f07f362283676bf1eaaaecc to your computer and use it in GitHub Desktop.
Save wmakeev/d6d37c8f4f07f362283676bf1eaaaecc to your computer and use it in GitHub Desktop.
Use cloudant node.js lib #cloudant
const Cloudant = require('@cloudant/cloudant')
const {
CLOUDANT_ACCOUNT,
CLOUDANT_DB,
CLOUDANT_KEY
CLOUDANT_PASSWORD
} = process.env
const cloudant = Cloudant({
account: CLOUDANT_ACCOUNT,
key: CLOUDANT_KEY,
password: CLOUDANT_PASSWORD,
plugin: 'promises'
})
const db = cloudant.db.use(CLOUDANT_DB)
const keys = ['100', '200']
let { total_rows, rows } = await db.fetch({ keys })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment