Skip to content

Commit fc90126

Browse files
query fixes (part 1)
1 parent d2bc30d commit fc90126

File tree

2 files changed

+4
-35
lines changed

2 files changed

+4
-35
lines changed

datastore/index.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,6 @@ Index.prototype.testExplodingProperties = function(callback) {
4444
created: new Date()
4545
}
4646
};
47-
48-
datastore.insert(task, function(err) {
49-
if (!err) {
50-
// Task inserted successfully.
51-
}
52-
});
5347
// [END exploding_properties]
5448

5549
delete datastore.key;

datastore/query.js

Lines changed: 4 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ Query.prototype.getAncestorQuery = function() {
4747
var datastore = this.datastore;
4848

4949
// [START anscestor_query]
50-
// SELECT * FROM Task WHERE __key__ HAS ANCESTOR ("TaskList", "default")
5150
var ancestorKey = datastore.key(['TaskList', 'default']);
5251

5352
var query = datastore.createQuery('Task')
@@ -62,9 +61,9 @@ Query.prototype.testRunQuery = function(callback) {
6261

6362
// jshint unused:false
6463
// [START run_query]
65-
datastore.runQuery(query, function(err, entities) {
64+
datastore.runQuery(query, function(err, tasks) {
6665
if (!err) {
67-
// Entities found.
66+
// Task entities found.
6867
}
6968
});
7069
// [END run_query]
@@ -100,7 +99,7 @@ Query.prototype.testKeyFilter = function(callback) {
10099

101100
// [START key_filter]
102101
var query = datastore.createQuery('Task')
103-
.filter('__key__ =', datastore.key(['Task', 'someTask']));
102+
.filter('__key__ >', datastore.key(['Task', 'someTask']));
104103
// [END key_filter]
105104

106105
this.datastore.runQuery(query, callback);
@@ -146,7 +145,7 @@ Query.prototype.testKindlessQuery = function(callback) {
146145

147146
// [START kindless_query]
148147
var query = datastore.createQuery()
149-
.filter('__key__ =', lastSeenKey);
148+
.filter('__key__ >', lastSeenKey);
150149
// [END kindless_query]
151150

152151
this.datastore.runQuery(query, callback);
@@ -361,28 +360,4 @@ Query.prototype.testEventualConsistentQuery = function(callback) {
361360
this.datastore.runQuery(query, callback);
362361
};
363362

364-
Query.prototype.testIndex1Query1 = function() {
365-
// [START index1_query1]
366-
// GQL is not supported in gcloud-node.
367-
// [END index1_query1]
368-
};
369-
370-
Query.prototype.testIndex1Query2 = function() {
371-
// [START index1_query2]
372-
// GQL is not supported in gcloud-node.
373-
// [END index1_query2]
374-
};
375-
376-
Query.prototype.testIndex2Query1 = function() {
377-
// [START index2_query1]
378-
// GQL is not supported in gcloud-node.
379-
// [END index2_query1]
380-
};
381-
382-
Query.prototype.testIndex2Query2 = function() {
383-
// [START index2_query2]
384-
// GQL is not supported in gcloud-node.
385-
// [END index2_query1]
386-
};
387-
388363
module.exports = Query;

0 commit comments

Comments
 (0)