Permalink
Browse files

MB-6181: Use meta.id instead of doc._id for view

Since we separate meta data from doc fields, we need to replace
doc._id with meta.id in the view design docs.

Change-Id: I050542e7fcf69ac1edf3c03b417bdd9126c4c3f5
Reviewed-on: http://review.couchbase.org/19480
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Tested-by: Bin Cui <bin.cui@gmail.com>
  • Loading branch information...
1 parent 9522e46 commit 11d89e5ebb72159662278bb7c5ac66cc9a331c1b @bcui6611 bcui6611 committed Aug 10, 2012
View
Binary file not shown.
View
BIN gamesim-sample.zip 100644 → 100755
Binary file not shown.
@@ -3,10 +3,10 @@
"language": "javascript",
"views": {
"leaderboard": {
- "map": "function (doc) {\n if (doc.jsonType == \"player\") {\n emit(doc.experience, null);\n }\n}"
+ "map": "function (doc, meta) {\n if (doc.jsonType == \"player\") {\n emit(doc.experience, null);\n }\n}"
},
"playerlist": {
- "map": "function (doc) {\n if (doc.jsonType == \"player\") {\n emit(doc._id, null);\n }\n}"
+ "map": "function (doc, meta) {\n if (doc.jsonType == \"player\") {\n emit(meta.id, null);\n }\n}"
}
}
}

0 comments on commit 11d89e5

Please sign in to comment.