Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

datastore: scope Key creation to include NS. fixes #116. #124

Merged
merged 7 commits into from
Aug 22, 2014
Prev Previous commit
Next Next commit
datastore: prefer namespace over ns naming convention.
  • Loading branch information
stephenplusplus committed Aug 21, 2014
commit dc6dd17464a1bce147c7b36fc22c7198b31b9cb8
14 changes: 7 additions & 7 deletions lib/datastore/dataset.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ function Dataset(options) {
scopes: SCOPES
});
this.id = options.projectId;
this.ns = options.namespace;
this.namespace = options.namespace;
this.transaction = this.createTransaction_();
}

Expand All @@ -103,7 +103,7 @@ function Dataset(options) {
Dataset.prototype.key = function(keyConfig) {
if (!util.is(keyConfig, 'object')) {
keyConfig = {
namespace: this.ns,
namespace: this.namespace,
path: util.toArray(arguments)
};
}
Expand All @@ -117,7 +117,7 @@ Dataset.prototype.key = function(keyConfig) {
*
* @borrows {module:datastore/query} as createQuery
*
* @param {string=} ns - Optional namespace.
* @param {string=} namespace - Optional namespace.
* @param {string|array} kinds - Kinds to query.
*
* @example
Expand All @@ -136,12 +136,12 @@ Dataset.prototype.key = function(keyConfig) {
* ```
* @return {module:datastore/query}
*/
Dataset.prototype.createQuery = function(ns, kinds) {
Dataset.prototype.createQuery = function(namespace, kinds) {
if (arguments.length === 1) {
kinds = util.arrayize(ns);
ns = this.ns;
kinds = util.arrayize(namespace);
namespace = this.namespace;
}
return new Query(ns, util.arrayize(kinds));
return new Query(namespace, util.arrayize(kinds));
};

/**
Expand Down