cannot create database with '/' in name
Created by: squirrelpiles
per CouchDB docs, database names can contain a forward slash '/'. I am trying to do this using lua-Spore, but cannot get it to work.
I want to be able to create names like: aaa/bbb/ccc
thank you. - dave
Here is code I am testing with:
local base = 'https://raw.github.com/SPORE/api-description/master/apps/couchdb/' local couchdb = require 'Spore'.new_from_spec( base .. 'server.json', base .. 'database.json', base .. 'document.json', base .. 'design.json', { base_url = 'http://127.0.0.1:5984/' }) couchdb:enable_if(function (req) return req.env.spore.caller ~= 'get_attachment' end, 'Format.JSON')
https://wiki.apache.org/couchdb/HTTP_database_API
-- from-- All database files are stored in a single directory on the file system. If your database -- includes a / CouchDB will create a sub-directory structure in the database directory. That -- is, a database named his/her, the database file will be available at $dbdir/his/her.couch. -- This is useful when you have a large number of databases and your file system does not like that.
-- this works: curl -X PUT http://localhost:5984/foo%2Fjnk
-- this doesn't: local r = couchdb:create_db{ db = 'foo/jnk' }