diff --git a/lib/cradle/database/views.js b/lib/cradle/database/views.js index 9d76e2f..9f916eb 100644 --- a/lib/cradle/database/views.js +++ b/lib/cradle/database/views.js @@ -86,8 +86,14 @@ Database.prototype.list = function (path, options) { var callback = new(Args)(arguments).callback; path = path.split('/'); + if (path.length < 4) { + path = ['_design', path[0], '_list', path[1], path[2]].map(querystring.escape).join('/'); + } else { + path = ['_design', path[0], '_list', path[1], path[2], path[3]].map(querystring.escape).join('/'); + } + this._getOrPostView( - ['_design', path[0], '_list', path[1], path[2]].map(querystring.escape).join('/'), + path, options, callback );