File tree 3 files changed +9
-22
lines changed
3 files changed +9
-22
lines changed Original file line number Diff line number Diff line change @@ -185,7 +185,7 @@ Dataset.prototype.key = function(options) {
185
185
} ;
186
186
187
187
/**
188
- * Create a query from the current dataset to query the specified kinds , scoped
188
+ * Create a query from the current dataset to query the specified kind , scoped
189
189
* to the namespace provided at the initialization of the dataset.
190
190
*
191
191
* *[Reference](http://goo.gl/Cag0r6).*
@@ -194,16 +194,16 @@ Dataset.prototype.key = function(options) {
194
194
* @see {module:datastore/query}
195
195
*
196
196
* @param {string= } namespace - Optional namespace.
197
- * @param {string|array } kinds - Kinds to query.
197
+ * @param {string } kind - Kind to query.
198
198
* @return {module:datastore/query }
199
199
*/
200
- Dataset . prototype . createQuery = function ( namespace , kinds ) {
200
+ Dataset . prototype . createQuery = function ( namespace , kind ) {
201
201
if ( arguments . length === 1 ) {
202
- kinds = util . arrayize ( namespace ) ;
202
+ kind = util . arrayize ( namespace ) ;
203
203
namespace = this . namespace ;
204
204
}
205
205
206
- return new Query ( namespace , util . arrayize ( kinds ) ) ;
206
+ return new Query ( namespace , util . arrayize ( kind ) ) ;
207
207
} ;
208
208
209
209
/**
Original file line number Diff line number Diff line change @@ -41,18 +41,18 @@ var util = require('../common/util.js');
41
41
* @alias module:datastore/query
42
42
*
43
43
* @param {string= } namespace - Namespace to query entities from.
44
- * @param {string[] } kinds - Kinds to query.
44
+ * @param {string } kind - Kind to query.
45
45
*
46
46
* @example
47
47
* // If your dataset was scoped to a namespace at initialization, your query
48
48
* // will likewise be scoped to that namespace.
49
- * dataset.createQuery([ 'Lion', 'Chimp'] );
49
+ * dataset.createQuery('Lion');
50
50
*
51
51
* // However, you may override the namespace per query.
52
- * dataset.createQuery('AnimalNamespace', [ 'Lion', 'Chimp'] );
52
+ * dataset.createQuery('AnimalNamespace', 'Lion');
53
53
*
54
54
* // You may also remove the namespace altogether.
55
- * dataset.createQuery(null, [ 'Lion', 'Chimp'] );
55
+ * dataset.createQuery(null, 'Lion');
56
56
*/
57
57
function Query ( namespace , kinds ) {
58
58
if ( ! kinds ) {
Original file line number Diff line number Diff line change @@ -43,19 +43,6 @@ describe('Query', function() {
43
43
assert . equal ( query . namespace , 'ns' ) ;
44
44
} ) ;
45
45
46
- it ( 'should support querying multiple kinds' , function ( ) {
47
- var query = new Query ( [ 'kind1' , 'kind2' ] ) ;
48
- var queryWithNamespace = new Query ( 'ns' , [ 'kind1' , 'kind2' ] ) ;
49
-
50
- assert . strictEqual ( query . namespace , null ) ;
51
- assert . equal ( query . kinds [ 0 ] , 'kind1' ) ;
52
- assert . equal ( query . kinds [ 1 ] , 'kind2' ) ;
53
-
54
- assert . equal ( queryWithNamespace . namespace , 'ns' ) ;
55
- assert . equal ( queryWithNamespace . kinds [ 0 ] , 'kind1' ) ;
56
- assert . equal ( queryWithNamespace . kinds [ 1 ] , 'kind2' ) ;
57
- } ) ;
58
-
59
46
it ( 'should support field selection by field name' , function ( ) {
60
47
var query = new Query ( [ 'kind1' ] )
61
48
. select ( [ 'name' , 'title' ] ) ;
You can’t perform that action at this time.
0 commit comments