Skip to content

Commit 0b8c7c3

Browse files
WalterHubjmdobry
authored andcommitted
Uses 'category' instead of 'type' as a property name (#171)
1 parent 808eb16 commit 0b8c7c3

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

datastore/concepts.js

+10-10
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ Entity.prototype.getKeyWithMultiLevelParent = function () {
106106
Entity.prototype.getTask = function () {
107107
// [START basic_entity]
108108
var task = {
109-
type: 'Personal',
109+
category: 'Personal',
110110
done: false,
111111
priority: 4,
112112
description: 'Learn Cloud Datastore'
@@ -151,7 +151,7 @@ Entity.prototype.testEntityWithParent = function (callback) {
151151
var task = {
152152
key: taskKey,
153153
data: {
154-
type: 'Personal',
154+
category: 'Personal',
155155
done: false,
156156
priority: 4,
157157
description: 'Learn Cloud Datastore'
@@ -167,7 +167,7 @@ Entity.prototype.testProperties = function (callback) {
167167
// [START properties]
168168
var task = [
169169
{
170-
name: 'type',
170+
name: 'category',
171171
value: 'Personal'
172172
},
173173
{
@@ -281,7 +281,7 @@ Entity.prototype.testLookup = function (callback) {
281281
// Task found.
282282

283283
// entity.data = {
284-
// type: 'Personal',
284+
// category: 'Personal',
285285
// done: false,
286286
// priority: 4,
287287
// description: 'Learn Cloud Datastore'
@@ -368,14 +368,14 @@ Entity.prototype.testBatchUpsert = function (callback) {
368368
var taskKey2 = this.datastore.key(['Task', 2]);
369369

370370
var task1 = {
371-
type: 'Personal',
371+
category: 'Personal',
372372
done: false,
373373
priority: 4,
374374
description: 'Learn Cloud Datastore'
375375
};
376376

377377
var task2 = {
378-
type: 'Work',
378+
category: 'Work',
379379
done: false,
380380
priority: 8,
381381
description: 'Integrate Cloud Datastore'
@@ -849,8 +849,8 @@ Query.prototype.testDistinctQuery = function (callback) {
849849

850850
// [START distinct_query]
851851
var query = datastore.createQuery('Task')
852-
.groupBy(['type', 'priority'])
853-
.order('type')
852+
.groupBy(['category', 'priority'])
853+
.order('category')
854854
.order('priority');
855855
// [END distinct_query]
856856

@@ -862,8 +862,8 @@ Query.prototype.testDistinctOnQuery = function (callback) {
862862

863863
// [START distinct_on_query]
864864
var query = datastore.createQuery('Task')
865-
.groupBy('type')
866-
.order('type')
865+
.groupBy('category')
866+
.order('category')
867867
.order('priority');
868868
// [END distinct_on_query]
869869

0 commit comments

Comments
 (0)