Closed csantanapr closed 6 years ago
Having same issue with db.insert()
".then is not a function"
Plugins must be passed via the plugins
parameter in the Cloudant client constructor (formerly known as plugin
).
Example:
const cloudant = Cloudant({ account: process.env.USERNAME, password: process.env.PASSWORD, plugins: 'promises' })
The plugins
parameter can also take an array to support multiple plugins, see here.
Take a look at the API migration document for further info.
Oh, didn’t realize that was a change, can we catch this early? Throw an exception if the user uses the formerly “plugin”?
Bug Description
Migrating code from
require('cloudant')
torequire('@cloudant/cloudant')
and using promise I get error then is not a function.This is part of enabling IBM Functions users to use new nodejs:10 runtime that npm package
cloudant
is removed and the `@cloudant/cloudant' is included instead and all user encourage to migrate their code to the new library.sorry if this is a stupid mistake using the new lib.
1. Steps to reproduce and the simplest code sample possible to demonstrate the issue
Here is code sample to reproduce
2. What you expected to happen
No errors and a print message about success or catched error Using
` code
require("cloudant")` works:3. What actually happened
I get error
cloudant.db.destroy(...).then is not a function
Environment details