Permalink
Browse files

Enable setting cache option when defining CouchDB conenction

  • Loading branch information...
fadrizul committed Mar 26, 2012
1 parent 615b97b commit bc1adfc31044760a3a8da10b5da0005ae9bd552b
Showing with 6 additions and 8 deletions.
  1. +6 −8 lib/connection.js
View
@@ -4,25 +4,23 @@ var cradle = require('cradle'),
module.exports.create_connection = function (options) {
if (typeof(options) === 'string') {
- logger.info("Connecting to %s",options);
+ logger.info("Connecting to %s",options);
db = new (cradle.Connection)().database(options);
-
+
return db;
- }
-
+ }
+
var _options = {},
db_name = options.db,
url = options.url,
port = options.port;
_options.secure = options.secure || false;
- _options.auth = options.auth;
+ _options.auth = options.auth;
+ _options.cache = options.cache === false ? false : true;
-
-
db = new (cradle.Connection)(url,port, _options).database(db_name);
-
return db;
};

0 comments on commit bc1adfc

Please sign in to comment.