Created
March 23, 2018 08:23
-
-
Save wmakeev/d6d37c8f4f07f362283676bf1eaaaecc to your computer and use it in GitHub Desktop.
Use cloudant node.js lib #cloudant
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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