cloudant / nodejs-cloudant

Cloudant Node.js client library
Apache License 2.0
255 stars 90 forks source link

Migrated from Cloudant to @cloudant/cloudant #431

Closed medojusrinivas closed 3 years ago

medojusrinivas commented 3 years ago

Hi there,

Migrated from Cloudant to @cloudant/cloudant

I have migrated the cloudant version from old to newer one as I see old one is deprecated and asked to move to newer version.

As there is just npm change in package.json and change in the require(), we followed the same thing. From Then I am seeing some errors are coming not frequently but error occurs in one or 2 weeks time gap.

Error: The database could not be created, the file already exists. Don't go with error, It got fixed when we restarted the application.

My Query is, Is it just enough to change the npm module name or do I need reconfigure the whole code which was working fine all these days.

Please do the needful. Thanks in Advance.

ricellis commented 3 years ago

Error: The database could not be created, the file already exists.

This error is returned by the server when you try to create a database that already exists. I don't think any of the changes between versions would cause this problem, only the application making a request to create a database that already exists can cause this.

This library follows semantic versioning. There are breaking changes in each of the major version changes. The application code changes needed for each major version are summarized in the API migration doc. Noting that cloudant was 1.x and @cloudant/cloudant has been 2.x/3.x and is currently 4.x so depending which of the functions you are using you may need to make changes from all the major versions outlined in that document.

You can see the complete list of changes present in each version in the change log and release notes.

Finally, as you are migrating code you may wish to note that we have a new library at https://github.com/IBM/cloudant-node-sdk/ (npm: @ibm-cloud/cloudant) that is currently in beta, but will eventually replace @cloudant/cloudant. That library does use completely new APIs so would require a complete re-write. Of course there will be an announcement and a substantial notice period before the end of support for @cloudant/cloudant.

ricellis commented 3 years ago

Closing this issue, please let us know if you need more information.