From c691f773ad514993169c57cbf8561cbf8f5e9214 Mon Sep 17 00:00:00 2001 From: Jason Serafin Date: Sat, 28 Feb 2015 16:53:08 -0500 Subject: [PATCH] Allow 'excludeFromIndexes' on listValues Need to be able to turn off indexes on lists to prevent exploding indexes --- lib/datastore/request.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/datastore/request.js b/lib/datastore/request.js index d4556472e1d..2576ee414d7 100644 --- a/lib/datastore/request.js +++ b/lib/datastore/request.js @@ -260,10 +260,17 @@ DatastoreRequest.prototype.save = function(entities, callback) { data.value = entity.valueToProperty(data.value); if (util.is(data.excludeFromIndexes, 'boolean')) { - data.value.indexed = !data.excludeFromIndexes; + + if(util.is(data.value.list_value, 'array')){ + + for(var listValueIndex in data.value.list_value){ + data.value.list_value[listValueIndex]['indexed'] = !data.excludeFromIndexes + } + } else { + data.value.indexed = !data.excludeFromIndexes; + } delete data.excludeFromIndexes; } - return data; }); } else {