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:
47
47
delete <taskId> Deletes a task.
48
48
49
49
Options:
50
- --help Show help [boolean]
50
+ --version Show version number [boolean]
51
+ --help Show help [boolean]
51
52
52
53
Examples:
53
54
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 {
1033
1033
1034
1034
testEventualConsistentQuery ( t ) {
1035
1035
t . plan ( 0 ) ;
1036
+ const datastoreMock = datastore ;
1037
+ datastore = this . datastore ;
1036
1038
// [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' } ) ;
1038
1044
// [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
+ } ) ;
1039
1055
}
1040
1056
}
1041
1057
Original file line number Diff line number Diff line change 9
9
"url" : " https://github.com/GoogleCloudPlatform/nodejs-docs-samples.git"
10
10
},
11
11
"engines" : {
12
- "node" : " >=4.3.2 "
12
+ "node" : " >=4"
13
13
},
14
14
"scripts" : {
15
15
"lint" : " samples lint" ,
18
18
},
19
19
"dependencies" : {
20
20
"@google-cloud/datastore" : " 1.1.0" ,
21
- "yargs" : " 8 .0.2 "
21
+ "yargs" : " 9 .0.1 "
22
22
},
23
23
"devDependencies" : {
24
24
"@google-cloud/nodejs-repo-tools" : " 1.4.17" ,
25
- "ava" : " 0.21 .0" ,
25
+ "ava" : " 0.22 .0" ,
26
26
"proxyquire" : " 1.8.0" ,
27
- "sinon" : " 3.2 .0"
27
+ "sinon" : " 3.3 .0"
28
28
},
29
29
"cloud-repo-tools" : {
30
30
"requiresKeyFile" : true ,
You can’t perform that action at this time.
0 commit comments