Skip to content
This repository has been archived by the owner on Nov 5, 2018. It is now read-only.

Commit

Permalink
Added _config
Browse files Browse the repository at this point in the history
  • Loading branch information
dscape committed Aug 16, 2011
1 parent 0377b9e commit a1d724d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ you normally don't want to do that though:
});
});

the `alicedb.use` method creates a `scope` where you operate inside a single database. this is just a convenience so you don't have to specify the database name every single time you do an update or delete
the `nano.use` method creates a `scope` where you operate inside a single database. this is just a convenience so you don't have to specify the database name every single time you do an update or delete

// 5: var alicedb = nano.use("alice");

Expand Down Expand Up @@ -72,6 +72,7 @@ that's it. don't forget to delete the database you created:
`nano.db.replicate(source,target,continuous*,callback*)`
`nano.use(db_name)`
`nano.request(opts,callback*)`
`nano.config(callback)`

#### aliases

Expand Down Expand Up @@ -125,7 +126,7 @@ this is the same as (assuming `db = nano.use("alice");`):
3. convenience functions for attachments
4. support views
5. support bulk load
6. `_uuids`, `_stats`, `_config`, `_active_tasks`, `_all_docs_by_seq`
6. `_uuids`, `_stats`, `_config`, `_active_tasks`
7. support `batch` in updates and inserts

## contribute
Expand Down
8 changes: 8 additions & 0 deletions nano.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,13 @@ module.exports = exports = nano = function database_module(cfg) {
if(continuous) { body.continuous = true; }
relax({db: "_replicate", body: body, method: "POST"},callback);
}

function config(callback) {
relax({db: "_config", method: "GET"}, function (e,h,r) {
if(e) { callback(e); }
callback(null,h,{nano: cfg, couch: r});
});
}

/****************************************************************************
* doc *
Expand Down Expand Up @@ -302,6 +309,7 @@ module.exports = exports = nano = function database_module(cfg) {
, use: document_module
, scope: document_module // Alias
, request: relax
, config: config
, relax: relax // Alias
, dinosaur: relax // Alias
};
Expand Down

0 comments on commit a1d724d

Please sign in to comment.