Skip to content

Commit

Permalink
MB-6181: Use meta.id instead of doc._id for view
Browse files Browse the repository at this point in the history
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
bcui6611 committed Aug 10, 2012
1 parent 9522e46 commit 11d89e5
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 2 deletions.
Binary file modified beer-sample.zip
Binary file not shown.
Binary file modified gamesim-sample.zip 100644 → 100755
Binary file not shown.
4 changes: 2 additions & 2 deletions gamesim-sample/design_docs/players.json
Expand Up @@ -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.