Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion datastore/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ Commands:
delete <taskId> Deletes a task.

Options:
--help Show help [boolean]
--version Show version number [boolean]
--help Show help [boolean]

Examples:
node tasks.js new "Buy milk" Adds a task with description "Buy milk".
Expand Down
18 changes: 17 additions & 1 deletion datastore/concepts.js
Original file line number Diff line number Diff line change
Expand Up @@ -1033,9 +1033,25 @@ class Query extends TestHelper {

testEventualConsistentQuery (t) {
t.plan(0);
const datastoreMock = datastore;
datastore = this.datastore;
// [START eventual_consistent_query]
// Read consistency cannot be specified in google-cloud-node.
const ancestorKey = datastore.key(['TaskList', 'default']);
const query = datastore.createQuery('Task')
.hasAncestor(ancestorKey);

query.run({ consistency: 'eventual' });
// [END eventual_consistent_query]
return query.run({ consistency: 'eventual' })
.then((results) => {
datastore = datastoreMock;
const entities = results[0];
return entities;
})
.catch((err) => {
datastore = datastoreMock;
return Promise.reject(err);
});
}
}

Expand Down
8 changes: 4 additions & 4 deletions datastore/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"url": "https://github.com/GoogleCloudPlatform/nodejs-docs-samples.git"
},
"engines": {
"node": ">=4.3.2"
"node": ">=4"
},
"scripts": {
"lint": "samples lint",
Expand All @@ -18,13 +18,13 @@
},
"dependencies": {
"@google-cloud/datastore": "1.1.0",
"yargs": "8.0.2"
"yargs": "9.0.1"
},
"devDependencies": {
"@google-cloud/nodejs-repo-tools": "1.4.17",
"ava": "0.21.0",
"ava": "0.22.0",
"proxyquire": "1.8.0",
"sinon": "3.2.0"
"sinon": "3.3.0"
},
"cloud-repo-tools": {
"requiresKeyFile": true,
Expand Down