couchbase
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -10,3 +10,4 @@ 'use strict'; | ||
var HOSTKEY_COMPAT = ['hosts', 'hostname', 'hostnames']; | ||
var fs = require('fs'); | ||
var path = require('path'); | ||
httpUtil._init(CONST); | ||
@@ -1078,3 +1079,11 @@ viewQuery._init(CONST); | ||
get: function() { | ||
return this._ctl(CONST.CNTL_COUCHNODE_VERSION); | ||
var pkgJson = fs.readFileSync( | ||
path.resolve(__dirname, '../package.json')); | ||
var jsVersion = JSON.parse(pkgJson).version; | ||
var components = jsVersion.split('.'); | ||
var hexValue = components[0] << 16 | | ||
components[1] << 8 | | ||
components[2]; | ||
return [hexValue, jsVersion]; | ||
}, | ||
@@ -1108,3 +1117,17 @@ writeable: false | ||
/** | ||
* Return an array of <code>(server index, vbucket id)</code> for the | ||
* provided key. | ||
* | ||
* @param {string} key the key to map | ||
* @return array | ||
* | ||
* @private | ||
* @ignore | ||
*/ | ||
Connection.prototype.vbMappingInfo = function(key) { | ||
return this._ctl(CONST.LCB_CNTL_VBMAP, key); | ||
}; | ||
/** | ||
@@ -1111,0 +1134,0 @@ * Returns a ViewQuery object representing the requested view. |
@@ -9,3 +9,3 @@ 'use strict'; | ||
CONST = c; | ||
} | ||
}; | ||
@@ -21,3 +21,3 @@ function makeRestHandler(innerCallback) { | ||
try { | ||
body = JSON.parse(response.data) | ||
body = JSON.parse(response.data); | ||
} catch (parseError) { | ||
@@ -58,2 +58,4 @@ // Error talking to server, pass the error on for now | ||
innerCallback(errObj, body.results); | ||
} else if (body.views) { | ||
innerCallback(errObj, body); | ||
} else { | ||
@@ -69,3 +71,3 @@ innerCallback(errObj, null); | ||
return new viewQuery.ViewQuery(cb, ddoc, name, query, makeRestHandler); | ||
} | ||
}; | ||
@@ -89,3 +91,3 @@ | ||
}, makeRestHandler(callback)); | ||
} | ||
}; | ||
@@ -98,3 +100,3 @@ module.exports.getDesignDoc = function(cb, name, callback) { | ||
}, makeRestHandler(callback)); | ||
} | ||
}; | ||
@@ -107,2 +109,2 @@ module.exports.removeDesignDoc = function(cb, name, callback) { | ||
}, makeRestHandler(callback)); | ||
} | ||
}; |
@@ -17,7 +17,8 @@ { | ||
"longjohn": "0.2.1", | ||
"underscore": "1.5.1" | ||
"underscore": "1.5.1", | ||
"mocha": "1.13.0" | ||
}, | ||
"repository" : { "type" : "git", "url" : "http://github.com/couchbase/couchnode.git" }, | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"gypfile": true | ||
} |
@@ -107,4 +107,10 @@ # Couchnode - Fast and Native Node.JS Client for Couchbase | ||
## Running Tests | ||
To run the unit tests built into the Node.js driver. Make sure you have | ||
mocha installed globally on your system, then execute mocha in the root | ||
directory of your couchnode installation. | ||
## Contributing changes | ||
See CONTRIBUTING.md |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
115
247304
4
54
2993