File tree Expand file tree Collapse file tree 3 files changed +23
-6
lines changed Expand file tree Collapse file tree 3 files changed +23
-6
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,8 @@ Commands:
4747 delete <taskId> Deletes a task.
4848
4949Options:
50- --help Show help [boolean]
50+ --version Show version number [boolean]
51+ --help Show help [boolean]
5152
5253Examples:
5354 node tasks.js new "Buy milk" Adds a task with description "Buy milk".
Original file line number Diff line number Diff line change @@ -1033,9 +1033,25 @@ class Query extends TestHelper {
10331033
10341034 testEventualConsistentQuery ( t ) {
10351035 t . plan ( 0 ) ;
1036+ const datastoreMock = datastore ;
1037+ datastore = this . datastore ;
10361038 // [START eventual_consistent_query]
1037- // Read consistency cannot be specified in google-cloud-node.
1039+ const ancestorKey = datastore . key ( [ 'TaskList' , 'default' ] ) ;
1040+ const query = datastore . createQuery ( 'Task' )
1041+ . hasAncestor ( ancestorKey ) ;
1042+
1043+ query . run ( { consistency : 'eventual' } ) ;
10381044 // [END eventual_consistent_query]
1045+ return query . run ( { consistency : 'eventual' } )
1046+ . then ( ( results ) => {
1047+ datastore = datastoreMock ;
1048+ const entities = results [ 0 ] ;
1049+ return entities ;
1050+ } )
1051+ . catch ( ( err ) => {
1052+ datastore = datastoreMock ;
1053+ return Promise . reject ( err ) ;
1054+ } ) ;
10391055 }
10401056}
10411057
Original file line number Diff line number Diff line change 99 "url" : " https://github.com/GoogleCloudPlatform/nodejs-docs-samples.git"
1010 },
1111 "engines" : {
12- "node" : " >=4.3.2 "
12+ "node" : " >=4"
1313 },
1414 "scripts" : {
1515 "lint" : " samples lint" ,
1818 },
1919 "dependencies" : {
2020 "@google-cloud/datastore" : " 1.1.0" ,
21- "yargs" : " 8 .0.2 "
21+ "yargs" : " 9 .0.1 "
2222 },
2323 "devDependencies" : {
2424 "@google-cloud/nodejs-repo-tools" : " 1.4.17" ,
25- "ava" : " 0.21 .0" ,
25+ "ava" : " 0.22 .0" ,
2626 "proxyquire" : " 1.8.0" ,
27- "sinon" : " 3.2 .0"
27+ "sinon" : " 3.3 .0"
2828 },
2929 "cloud-repo-tools" : {
3030 "requiresKeyFile" : true ,
You can’t perform that action at this time.
0 commit comments