You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ja...@apache.org on 2021/08/12 09:32:30 UTC

[couchdb-nano] branch main updated: Document the options to `db.create()`

This is an automated email from the ASF dual-hosted git repository.

jan pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/couchdb-nano.git


The following commit(s) were added to refs/heads/main by this push:
     new 127a45c  Document the options to `db.create()`
     new dc122d4  Merge pull request #272 from neighbourhoodie/docs-db-create-options
127a45c is described below

commit 127a45c1ba746ac15ef6d0beab5b66accf1dcfb1
Author: James Coglan <ja...@neighbourhood.ie>
AuthorDate: Tue Aug 10 13:44:53 2021 +0100

    Document the options to `db.create()`
    
    In the source code, the `createDb()` function accepts an options object
    but this is not documented. The `PUT /{db}` endpoint [1] does have some
    query string options and `nano` users should be able to make use of
    them.
    
    [1]: https://docs.couchdb.org/en/stable/api/database/common.html#put--db
---
 README.md | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/README.md b/README.md
index 5fc3d69..31e3fd5 100644
--- a/README.md
+++ b/README.md
@@ -296,12 +296,12 @@ db.insert(p).then((response) => {
 
 ## Database functions
 
-### nano.db.create(name, [callback])
+### nano.db.create(name, [opts], [callback])
 
-Creates a CouchDB database with the given `name`:
+Creates a CouchDB database with the given `name`, with options `opts`.
 
 ```js
-await nano.db.create('alice')
+await nano.db.create('alice', { n: 3 })
 ```
 
 ### nano.db.get(name, [callback])