only exclude _id in SwellRT.query if not whitelist in projection in query
Project: http://git-wip-us.apache.org/repos/asf/incubator-wave/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-wave/commit/7b584872 Tree: http://git-wip-us.apache.org/repos/asf/incubator-wave/tree/7b584872 Diff: http://git-wip-us.apache.org/repos/asf/incubator-wave/diff/7b584872 Branch: refs/heads/swellrt Commit: 7b5848725d6e56ab7d9cf3df751a6f00b34f664f Parents: 0f7ee71 Author: Antonio Tenorio Fornés <antonioteno...@ucm.es> Authored: Mon Sep 26 18:18:32 2016 +0200 Committer: Antonio Tenorio Fornés <antonioteno...@ucm.es> Committed: Mon Sep 26 18:18:32 2016 +0200 ---------------------------------------------------------------------- .../org/swellrt/server/box/servlet/QueryModelService.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-wave/blob/7b584872/wave/src/main/java/org/swellrt/server/box/servlet/QueryModelService.java ---------------------------------------------------------------------- diff --git a/wave/src/main/java/org/swellrt/server/box/servlet/QueryModelService.java b/wave/src/main/java/org/swellrt/server/box/servlet/QueryModelService.java index 5b41faf..2d9ac40 100644 --- a/wave/src/main/java/org/swellrt/server/box/servlet/QueryModelService.java +++ b/wave/src/main/java/org/swellrt/server/box/servlet/QueryModelService.java @@ -62,11 +62,13 @@ public class QueryModelService extends BaseService { objectQuery.put("$or", limitPartQuery); - // exclude internal mongoDb _id - - objectProjection.put("_id", 0); // You cannot currently mix including and excluding fields if (!objectProjection.toMap().containsValue(1)) { + + // exclude internal mongoDb _id + objectProjection.put("_id", 0); + + // exclude wavelet id objectProjection.put("wavelet_id", 0); }