2

I need to check if a given database exists before querying it. I've looked at this question, but I cannot replicate on Node.js using CouchDB Nano.

Does anyone know how to check it using the Nano library?

Jonathan Hall
  • 75,165
  • 16
  • 143
  • 189
Michele Riva
  • 552
  • 9
  • 24

1 Answers1

1

I just find out there is an API to list al the databases from a given CouchDB server: https://github.com/apache/couchdb-nano#nanodblistcallback

My bad.

Michele Riva
  • 552
  • 9
  • 24
  • You can also use [nano.db.info](https://github.com/apache/couchdb-nano#nanodbinfocallback) and check for the "not found" error if you're looking for a specific database by name. – Dominic Barnes May 09 '19 at 07:13