From 1effe779f348c98274ce4faa5ad7da1684626017 Mon Sep 17 00:00:00 2001 From: Rufus Pollock Date: Sun, 9 Sep 2012 16:09:31 +0100 Subject: [PATCH] [#180,refactor][xs]: rename couchdb demo url to /couchdb/ from /couchdb_multiview/. --- demos/{couchdb_multiview => couchdb}/app.js | 0 .../{couchdb_multiview => couchdb}/index.html | 0 demos/index.html | 2 +- src/backend.couchdb.js | 32 +++++++++---------- 4 files changed, 17 insertions(+), 17 deletions(-) rename demos/{couchdb_multiview => couchdb}/app.js (100%) rename demos/{couchdb_multiview => couchdb}/index.html (100%) diff --git a/demos/couchdb_multiview/app.js b/demos/couchdb/app.js similarity index 100% rename from demos/couchdb_multiview/app.js rename to demos/couchdb/app.js diff --git a/demos/couchdb_multiview/index.html b/demos/couchdb/index.html similarity index 100% rename from demos/couchdb_multiview/index.html rename to demos/couchdb/index.html diff --git a/demos/index.html b/demos/index.html index 31b3bd3e..dcfd13ee 100644 --- a/demos/index.html +++ b/demos/index.html @@ -60,7 +60,7 @@ root: ../
-

CouchDB Demo

+

CouchDB Demo

Using CouchDB with Recline Multiview to provide an elegant powerful browser for a CouchDB database and view.

diff --git a/src/backend.couchdb.js b/src/backend.couchdb.js index f80ea81f..54f3f88a 100755 --- a/src/backend.couchdb.js +++ b/src/backend.couchdb.js @@ -14,7 +14,7 @@ my.__type__ = 'couchdb'; // // TODO Add user/password arguments for couchdb authentication support. // - // See the example how to use this in: "demos/couchdb_multiview" + // See the example how to use this in: "demos/couchdb/" my.CouchDBWrapper = function(db_url, view_url, options) { var self = this; self.endpoint = db_url; @@ -151,29 +151,29 @@ my.__type__ = 'couchdb'; // // Backbone connector for a CouchDB backend. // - // The couchdb is referring to my apache reverse proxy. You will need a proxy to connect to the database. + // var dataset = new recline.Model.Dataset({ + // db_url: path-to-couchdb-database e.g. '/couchdb/mydb', + // view_url: path-to-couchdb-database-view e.g. '/couchdb/mydb/_design/design1/_views/view1', + // backend: 'couchdb', + // query_options: { + // 'key': '_id' + // } + // }); // - // Usage: (also see demos/couchdb_multiview) - // var dataset = new recline.Model.Dataset({ - // db_url: '/couchdb/mydb', - // view_url: '/couchdb/mydb/_design/design1/_views/view1', - // backend: 'couchdb', - // query_options: { - // 'key': '_id' - // } - // }); - // - // backend.query(query, dataset.toJSON()).done(function () { ... }); + // backend.query(query, dataset.toJSON()).done(function () { ... }); // // Alternatively: - // var dataset = new recline.Model.Dataset({ ... }, 'couchdb'); - // dataset.fetch(); - // var results = dataset.query(query_obj); + // + // var dataset = new recline.Model.Dataset({ ... }, 'couchdb'); + // dataset.fetch(); + // var results = dataset.query(query_obj); // // Additionally, the Dataset instance may define three methods: + // // function record_update (record, document) { ... } // function record_delete (record, document) { ... } // function record_create (record, document) { ... } + // // Where `record` is the JSON representation of the Record/Document instance // and `document` is the JSON document stored in couchdb. // When _all_docs view is used (default), a record is the same as a document