Skip to content

Commit 8f5dc00

Browse files
WalterHubjmdobry
authored andcommitted
Shows how to exclude property from index (for docs) (#147)
* Exclude property from index (doc) * Excludes the description property
1 parent 76bea45 commit 8f5dc00

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

datastore/tasks.js

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,21 @@ function addTask (description, callback) {
7272

7373
datastore.save({
7474
key: taskKey,
75-
data: {
76-
created: new Date().toJSON(),
77-
description: description,
78-
done: false
79-
}
75+
data: [
76+
{
77+
name: 'created',
78+
value: new Date().toJSON()
79+
},
80+
{
81+
name: 'description',
82+
value: description,
83+
excludeFromIndexes: true
84+
},
85+
{
86+
name: 'done',
87+
value: false
88+
}
89+
]
8090
}, function (err) {
8191
if (err) {
8292
callback(err);

0 commit comments

Comments
 (0)