jo / couchdb-bootstrap

Bootstrap CouchDB projects: configure, setup security, deploy ddocs and create users.
Other
115 stars 13 forks source link

Is there support for creating partitioned databases? #60

Open davidgeary opened 3 years ago

davidgeary commented 3 years ago

I need to create a partitioned database, with the structure being defined using the 'CouchDB Filesystem Mapping'. I can't find any specific documentation showing an example of how this would be represented, but my guess has been to create a file in the folder representing the database called partitioned containing the value true (following the example in https://github.com/jo/couchdb-compile/tree/main/test/fixtures/full for specifying the language property).

However, if I then run couchdb-bootstrap via the CLI, I get:

C:\Dvt\devops\node_modules\couchdb-bootstrap\index.js:130
              if (!('_id' in doc)) doc._id = id
                          ^

TypeError: Cannot use 'in' operator to search for '_id' in true
    at C:\Dvt\devops\node_modules\couchdb-bootstrap\index.js:130:27
    at Array.reduce (<anonymous>)
    at C:\Dvt\devops\node_modules\couchdb-bootstrap\index.js:103:14
    at C:\Dvt\devops\node_modules\async\dist\async.js:243:13
    at eachOfArrayLike (C:\Dvt\devops\node_modules\async\dist\async.js:500:13)
    at eachOf (C:\Dvt\devops\node_modules\async\dist\async.js:551:16)
    at awaitable (C:\Dvt\devops\node_modules\async\dist\async.js:208:32)
    at _asyncMap (C:\Dvt\devops\node_modules\async\dist\async.js:241:16)
    at Object.map (C:\Dvt\devops\node_modules\async\dist\async.js:594:16)
    at Object.awaitable [as map] (C:\Dvt\devops\node_modules\async\dist\async.js:208:32)

So it looks like it's trying to interpret the file contents as a JSON document, rather than a property value.

Does couchdb-bootstrap (15.0.0) support creating partitioned databases and if so, what is the required file/folder structure to represent that?