{"id":1840,"date":"2014-12-16T17:37:09","date_gmt":"2014-12-16T17:37:09","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/?p=1840"},"modified":"2014-12-16T17:37:09","modified_gmt":"2014-12-16T17:37:09","slug":"working-social-game-entities-couchbase","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/pt\/working-social-game-entities-couchbase\/","title":{"rendered":"Trabalhar com entidades de jogos sociais no Couchbase"},"content":{"rendered":"<p><b id=\"internal-source-marker_0.7206992749124765\" style=\"font-weight: normal; \"><span style=\"font-size: 15px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">What\u2019s in a new social game? Fundamentally, a game is an \u201cexperience\u201d built around a series of interactions between the player, the content, and other players. Sure, the concept of the game, the storyline, the characters, and social components all have a huge influence on the game experience. But at the heart of a game\u2019s attraction are the objects in the game world, the mechanics associated with these objects and the rewards offered to players. To power all this virtual activity you need a high-performance and scalable database. <\/span><\/b><\/p>\n<p><b id=\"internal-source-marker_0.7206992749124765\" style=\"font-weight: normal; \"><span style=\"font-size: 15px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">In this blog, I\u2019ll share how Couchbase can be used to power your basic game elements &#8211; <\/span><span style=\"font-size: 15px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">Objects<\/span><span style=\"font-size: 15px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">, <\/span><span style=\"font-size: 15px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">Actions<\/span><span style=\"font-size: 15px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \"> and <\/span><span style=\"font-size: 15px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">Rewards<\/span><\/b><\/p>\n<div style=\"background-color: transparent; \">\n<h4 dir=\"ltr\" style=\"color: rgb(0, 0, 0); line-height: normal; font-family: Times; font-size: medium; \"><b id=\"internal-source-marker_0.7206992749124765\" style=\"font-weight: normal; \"><span style=\"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-weight: normal; font-style: normal; font-size: 24px; font-family: Arial; vertical-align: baseline; color: rgb(0, 0, 0); background-color: transparent; font-variant: normal; text-decoration: none; white-space: pre-wrap; \">Game Objects<\/span><\/b><\/h4>\n<div dir=\"ltr\" style=\"color: rgb(0, 0, 0); line-height: normal; font-family: Times; font-size: medium; \"><b id=\"internal-source-marker_0.7206992749124765\" style=\"font-weight: normal; \"><span style=\"font-size: 15px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">When you build an online social game, you typically represent elements that are part of the game world. They are called <\/span><span style=\"font-size: 15px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: bold; font-style: italic; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">game objects<\/span><span style=\"font-size: 15px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \"> and can be game characters, vanity items, functional items and buffs, etc. These object impacted by events in the game. \u00a0Some examples follow<\/span><\/b><\/div>\n<div style=\"background-color: transparent; \">\n<p dir=\"ltr\" style=\"color: rgb(0, 0, 0); line-height: normal; font-family: Times; font-size: medium; text-align: justify; margin-top: 0pt; margin-bottom: 0pt; \">\u00a0<\/p>\n<table align=\"left\" border=\"1\" cellpadding=\"1\" cellspacing=\"1\" style=\"color: rgb(0, 0, 0); line-height: normal; font-family: Times; font-size: medium; width: 500px; \">\n<thead>\n<tr>\n<th scope=\"col\">Game Object Type<\/th>\n<th scope=\"col\">Document Value<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Player<\/td>\n<td>\n<div style=\"background-color: transparent; color: rgb(0, 0, 0); font-family: Times; line-height: normal; font-size: medium; \"><b id=\"internal-source-marker_0.7206992749124765\" style=\"font-weight: normal; \"><span style=\"font-size: 13px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">{<\/span><br \/><span style=\"font-size: 13px; font-family: Arial; color: rgb(0, 0, 111); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">&#8220;type&#8221;<\/span><span style=\"font-size: 13px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">: <\/span><span style=\"font-size: 13px; font-family: Arial; color: rgb(212, 0, 54); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">&#8220;player&#8221;<\/span><span style=\"font-size: 13px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">,<\/span><br \/><span style=\"font-size: 13px; font-family: Arial; color: rgb(0, 0, 111); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">&#8220;uuid&#8221;<\/span><span style=\"font-size: 13px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">: <\/span><span style=\"font-size: 13px; font-family: Arial; color: rgb(212, 0, 54); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">&#8220;35767d02-\u00ad???a958&#8221;<\/span><span style=\"font-size: 13px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">,<\/span><br \/><span style=\"font-size: 13px; font-family: Arial; color: rgb(0, 0, 111); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">&#8220;name&#8221;<\/span><span style=\"font-size: 13px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">: <\/span><span style=\"font-size: 13px; font-family: Arial; color: rgb(212, 0, 54); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">&#8220;DonPinto4540&#8221;<\/span><span style=\"font-size: 13px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">,<\/span><br \/><span style=\"font-size: 13px; font-family: Arial; color: rgb(0, 0, 111); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">&#8220;score&#8221;<\/span><span style=\"font-size: 13px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">:<\/span><span style=\"font-size: 13px; font-family: Arial; color: rgb(10, 136, 135); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">663<\/span><span style=\"font-size: 13px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">,<\/span><br \/><span style=\"font-size: 13px; font-family: Arial; color: rgb(0, 0, 111); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">&#8220;level&#8221;<\/span><span style=\"font-size: 13px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">:<\/span><span style=\"font-size: 13px; font-family: Arial; color: rgb(10, 136, 135); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">4<\/span><span style=\"font-size: 13px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">,<\/span><br \/><span style=\"font-size: 13px; font-family: Arial; color: rgb(0, 0, 111); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">&#8220;loggedIn&#8221;<\/span><span style=\"font-size: 13px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">: <\/span><span style=\"font-size: 13px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">false<\/span><br \/><span style=\"font-size: 13px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">}<\/span><\/b><\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>Item<\/td>\n<td>\n<div style=\"background-color: transparent; color: rgb(0, 0, 0); font-family: Times; line-height: normal; font-size: medium; \"><b id=\"internal-source-marker_0.7206992749124765\" style=\"font-weight: normal; \"><span style=\"font-size: 13px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">{<\/span><br \/><span style=\"font-size: 13px; font-family: Arial; color: rgb(0, 0, 111); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">&#8220;type&#8221;<\/span><span style=\"font-size: 13px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">:<\/span><span style=\"font-size: 13px; font-family: Arial; color: rgb(212, 0, 54); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">&#8220;item&#8221;<\/span><span style=\"font-size: 13px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">,<\/span><br \/><span style=\"font-size: 13px; font-family: Arial; color: rgb(0, 0, 111); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">&#8220;name&#8221;<\/span><span style=\"font-size: 13px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">:<\/span><span style=\"font-size: 13px; font-family: Arial; color: rgb(212, 0, 54); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">&#8220;Axe_e5890c94-\u00ad???11&#8221;<\/span><span style=\"font-size: 13px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">,<\/span><br \/><span style=\"font-size: 13px; font-family: Arial; color: rgb(0, 0, 111); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">&#8220;uuid&#8221;<\/span><span style=\"font-size: 13px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">:<\/span><span style=\"font-size: 13px; font-family: Arial; color: rgb(212, 0, 54); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">&#8220;e5890c94-\u00ad???11c6-\u00ad???&#8221;<\/span><span style=\"font-size: 13px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">,<\/span><br \/><span style=\"font-size: 13px; font-family: Arial; color: rgb(0, 0, 111); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">&#8220;ownerId&#8221;<\/span><span style=\"font-size: 13px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">:<\/span><span style=\"font-size: 13px; font-family: Arial; color: rgb(212, 0, 54); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">&#8220;Dale9887&#8221;<\/span><br \/><span style=\"font-size: 13px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">}<\/span><\/b><\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>Monster<\/td>\n<td>\n<div style=\"background-color: transparent; line-height: normal; \">\n<div style=\"background-color: transparent; color: rgb(0, 0, 0); line-height: normal; \">\n<div style=\"background-color: transparent; color: rgb(0, 0, 0); font-family: Times; line-height: normal; font-size: medium; \"><font class=\"Apple-style-span\" face=\"Arial\" size=\"2\" style=\"color: rgb(0, 0, 0); \"><b id=\"internal-source-marker_0.7206992749124765\" style=\"font-weight: normal; \"><span style=\"font-size: 13px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">{<\/span><br \/><span style=\"font-size: 13px; font-family: Arial; color: rgb(0, 0, 111); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">&#8220;type&#8221;<\/span><span style=\"font-size: 13px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">:<\/span><span style=\"font-size: 13px; font-family: Arial; color: rgb(212, 0, 54); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">&#8220;monster&#8221;<\/span><span style=\"font-size: 13px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">,<\/span><br \/><span style=\"font-size: 13px; font-family: Arial; color: rgb(0, 0, 111); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">&#8220;name&#8221;<\/span><span style=\"font-size: 13px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">:<\/span><span style=\"font-size: 13px; font-family: Arial; color: rgb(212, 0, 54); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">&#8220;Goliath9932&#8221;<\/span><span style=\"font-size: 13px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">,<\/span><br \/><span style=\"font-size: 13px; font-family: Arial; color: rgb(0, 0, 111); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">&#8220;uuid&#8221;<\/span><span style=\"font-size: 13px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">:<\/span><span style=\"font-size: 13px; font-family: Arial; color: rgb(212, 0, 54); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">&#8220;d10dfc1b-\u00ad???0412-\u00ad???41&#8221;<\/span><span style=\"font-size: 13px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">,<\/span><br \/><span style=\"font-size: 13px; font-family: Arial; color: rgb(0, 0, 111); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">&#8220;hitpoints&#8221;<\/span><span style=\"font-size: 13px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">:<\/span><span style=\"font-size: 13px; font-family: Arial; color: rgb(10, 136, 135); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">370<\/span><span style=\"font-size: 13px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">,<\/span><br \/><span style=\"font-size: 13px; font-family: Arial; color: rgb(0, 0, 111); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">&#8220;experienceWhenKilled&#8221;<\/span><span style=\"font-size: 13px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">:<\/span><span style=\"font-size: 13px; font-family: Arial; color: rgb(10, 136, 135); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">52<\/span><span style=\"font-size: 13px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">,<\/span><br \/><span style=\"font-size: 13px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">}<\/span><\/b><\/font><\/div>\n<\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div>\n<div style=\"background-color: transparent; color: rgb(0, 0, 0); font-family: Times; line-height: normal; font-size: medium; \">\u00a0<\/div>\n<div style=\"background-color: transparent; color: rgb(0, 0, 0); font-family: Times; line-height: normal; font-size: medium; \">\u00a0<\/div>\n<div style=\"background-color: transparent; color: rgb(0, 0, 0); font-family: Times; line-height: normal; font-size: medium; \">\u00a0<\/div>\n<div style=\"background-color: transparent; color: rgb(0, 0, 0); font-family: Times; line-height: normal; font-size: medium; \">\u00a0<\/div>\n<div style=\"background-color: transparent; color: rgb(0, 0, 0); font-family: Times; line-height: normal; font-size: medium; \">\u00a0<\/div>\n<div style=\"background-color: transparent; color: rgb(0, 0, 0); font-family: Times; line-height: normal; font-size: medium; \">\u00a0<\/div>\n<div style=\"background-color: transparent; color: rgb(0, 0, 0); font-family: Times; line-height: normal; font-size: medium; \">\u00a0<\/div>\n<div style=\"background-color: transparent; color: rgb(0, 0, 0); font-family: Times; line-height: normal; font-size: medium; \">\u00a0<\/div>\n<div style=\"background-color: transparent; color: rgb(0, 0, 0); font-family: Times; line-height: normal; font-size: medium; \">\u00a0<\/div>\n<div style=\"background-color: transparent; color: rgb(0, 0, 0); font-family: Times; line-height: normal; font-size: medium; \">\u00a0<\/div>\n<div style=\"background-color: transparent; color: rgb(0, 0, 0); font-family: Times; line-height: normal; font-size: medium; \">\u00a0<\/div>\n<div style=\"background-color: transparent; color: rgb(0, 0, 0); font-family: Times; line-height: normal; font-size: medium; \">\u00a0<\/div>\n<div style=\"background-color: transparent; color: rgb(0, 0, 0); font-family: Times; line-height: normal; font-size: medium; \">\u00a0<\/div>\n<div style=\"background-color: transparent; color: rgb(0, 0, 0); font-family: Times; line-height: normal; font-size: medium; \">\u00a0<\/div>\n<div style=\"background-color: transparent; color: rgb(0, 0, 0); font-family: Times; line-height: normal; font-size: medium; \">\u00a0<\/div>\n<div style=\"background-color: transparent; color: rgb(0, 0, 0); font-family: Times; line-height: normal; font-size: medium; \">\u00a0<\/div>\n<div style=\"background-color: transparent; color: rgb(0, 0, 0); font-family: Times; line-height: normal; font-size: medium; \">\u00a0<\/div>\n<div style=\"background-color: transparent; color: rgb(0, 0, 0); font-family: Times; line-height: normal; font-size: medium; \">\u00a0<\/div>\n<div style=\"background-color: transparent; color: rgb(0, 0, 0); font-family: Times; line-height: normal; font-size: medium; \">\u00a0<\/div>\n<div style=\"background-color: transparent; color: rgb(0, 0, 0); font-family: Times; line-height: normal; font-size: medium; \">\u00a0<\/div>\n<div style=\"background-color: transparent; color: rgb(0, 0, 0); font-family: Times; line-height: normal; font-size: medium; \">\u00a0<\/div>\n<div style=\"background-color: transparent; color: rgb(0, 0, 0); font-family: Times; line-height: normal; font-size: medium; \">\u00a0<\/div>\n<p style=\"background-color: transparent; color: rgb(0, 0, 0); font-family: Times; line-height: normal; font-size: medium; \">\u00a0<\/p>\n<p style=\"background-color: transparent; color: rgb(0, 0, 0); font-family: Times; line-height: normal; font-size: medium; \">\u00a0<\/p>\n<p style=\"background-color: transparent; color: rgb(0, 0, 0); font-family: Times; line-height: normal; font-size: medium; \">\u00a0<\/p>\n<p style=\"background-color: transparent; color: rgb(0, 0, 0); font-family: Times; line-height: normal; font-size: medium; \"><b id=\"internal-source-marker_0.7206992749124765\" style=\"font-weight: normal; \"><span style=\"font-size: 15px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">In Couchbase, JSON documents are used to model game objects and are identified using the document id. For these documents, the <\/span><span style=\"font-size: 15px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: bold; font-style: italic; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">type<\/span><span style=\"font-size: 15px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \"> field is used to define the type of the object being stored.<\/span><\/b><\/p>\n<h3 style=\"background-color: transparent; color: rgb(0, 0, 0); line-height: normal; \"><b id=\"internal-source-marker_0.7206992749124765\" style=\"font-weight: normal; \"><span style=\"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-weight: normal; font-style: normal; font-size: 24px; font-family: Arial; vertical-align: baseline; border-style: initial; border-color: initial; color: rgb(0, 0, 0); background-color: transparent; font-variant: normal; text-decoration: none; white-space: pre-wrap; \">Game Actions<\/span><\/b><\/h3>\n<div style=\"color: rgb(0, 0, 0); line-height: normal; font-family: Times; font-size: medium; \"><b id=\"internal-source-marker_0.7206992749124765\" style=\"font-weight: normal; \"><span style=\"font-size: 15px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">As part of game play, players perform <\/span><span style=\"font-size: 15px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">actions<\/span><span style=\"font-size: 15px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \"> that may lead to the game objects being updated or changed. For example, players can move to different areas of a map, perform actions and earn rewards, and retrieve the coordinates of other players\u2019 that are currently in the game. \u00a0Each such player action translates to viewing, adding, removing or updating documents in the database. \u00a0<\/span><\/b><\/div>\n<div style=\"color: rgb(0, 0, 0); line-height: normal; font-family: Times; font-size: medium; \">\u00a0<\/div>\n<div style=\"color: rgb(0, 0, 0); line-height: normal; font-family: Times; font-size: medium; \"><b id=\"internal-source-marker_0.7206992749124765\" style=\"font-family: Times; font-size: medium; font-weight: normal; \"><span style=\"font-size: 15px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">In reality, social games have multiple players playing concurrently and their actions might impact the same object. As an example, actions performed in a game may require \u201cenergy\u201d and once a player runs out \u201cenergy\u201d, they need to recharge. Items such as speedup and energy packs are pretty common in social games give a quick boost of \u201cenergy\u201d to the player. But the fun comes from competing for the limited number of \u201cenergy\u201d packs in the game. Access to shared game objects needs to be synchronized to avoid conflicts and to maintain a consistent game state. Couchbase Server provides both <\/span><a href=\"https:\/\/www.couchbase.com\/docs\/couchbase-sdk-java-1.1\/couchbase-sdk-java-update-cas.html#table-couchbase-sdk_java_cas-expiry-transcoder\"><span style=\"font-size: 15px; font-family: Arial; color: rgb(17, 85, 204); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap; \">optimistic<\/span><\/a><span style=\"font-size: 15px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \"> and <\/span><a href=\"https:\/\/www.couchbase.com\/docs\/couchbase-sdk-java-1.1\/couchbase-sdk-java-retrieve-get-and-lock.html\"><span style=\"font-size: 15px; font-family: Arial; color: rgb(17, 85, 204); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap; \">pessimistic<\/span><\/a><span style=\"font-size: 15px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \"> concurrency control. <\/span><\/b><\/div>\n<\/div>\n<\/div>\n<div>\n<div style=\"background-color: transparent; color: rgb(0, 0, 0); font-family: Times; line-height: normal; font-size: medium; \">\u00a0<\/div>\n<div style=\"background-color: transparent; color: rgb(0, 0, 0); font-family: Times; line-height: normal; font-size: medium; \"><b id=\"internal-source-marker_0.7206992749124765\" style=\"font-weight: normal; \"><span style=\"font-size: 15px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">Here\u2019s how to use these concurrency mechanisms. Let\u2019s say two players want to attach the same tree-house at the same time. By using the CAS methods and retry logic, game programmers can guarantee atomic updates of global shared game objects to maintain consistent game state.<\/span><\/b><\/div>\n<div style=\"background-color: transparent; color: rgb(0, 0, 0); font-family: Times; line-height: normal; font-size: medium; \">\u00a0<\/div>\n<div class=\"rtecenter\" style=\"background-color: transparent; color: rgb(0, 0, 0); font-family: Times; line-height: normal; font-size: medium; \"><b style=\"font-weight: normal; \"><span style=\"font-size: 15px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.couchbase.com\/blog\/sites\/default\/files\/uploads\/all\/cas-game.jpg\" style=\"width: 461px; height: 600px; \" \/><\/span><\/b><\/div>\n<h4 dir=\"ltr\" style=\"margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-weight: inherit; font-style: inherit; font-size: medium; font-family: Times; vertical-align: baseline; line-height: 1.25; \"><font class=\"Apple-style-span\" size=\"3\"><b id=\"internal-source-marker_0.7206992749124765\" style=\"font-weight: normal; \"><span style=\"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-weight: normal; font-style: normal; font-size: 24px; font-family: Arial; vertical-align: baseline; border-style: initial; border-color: initial; color: rgb(0, 0, 0); background-color: transparent; font-variant: normal; text-decoration: none; white-space: pre-wrap; \">Game Rewards<\/span><\/b><\/font><\/h4>\n<div class=\"rteleft\" style=\"background-color: transparent; color: rgb(0, 0, 0); font-family: Times; line-height: normal; font-size: medium; \"><b id=\"internal-source-marker_0.7206992749124765\" style=\"font-weight: normal; \"><span style=\"font-size: 15px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">Most games have a structure composed of a cycle of actions and <\/span><span style=\"font-size: 15px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">rewards<\/span><span style=\"font-size: 15px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">. Scoring systems are used in games to allow players to measure how well they have mastered the game and also to make it a little addictive. A leaderboard is typically used to record players with top scores.<\/span><\/b><\/div>\n<\/div>\n<\/div>\n<p class=\"rtecenter\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.couchbase.com\/blog\/sites\/default\/files\/uploads\/all\/leaderboard_games.jpg\" style=\"width: 271px; height: 246px; \" \/><\/p>\n<p style=\"background-color: transparent; color: rgb(0, 0, 0); font-family: Times; line-height: normal; font-size: medium; \"><b id=\"internal-source-marker_0.7206992749124765\" style=\"font-weight: normal; \"><span style=\"font-size: 15px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">Game leaderboards can be created in Couchbase Server 2.0 using <\/span><a href=\"https:\/\/www.couchbase.com\/docs\/couchbase-manual-2.0\/couchbase-views.html\"><span style=\"font-size: 15px; font-family: Arial; color: rgb(17, 85, 204); background-color: transparent; font-weight: normal; font-style: italic; font-variant: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap; \">views<\/span><\/a><span style=\"font-size: 15px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">. A <\/span><span style=\"font-size: 15px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: italic; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">view<\/span><span style=\"font-size: 15px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \"> in Couchbase is written using map\/reduce functions that generate an index. For the JSON game objects shown in the game objects section, a map function (as shown below) can be used to generate a list of player scores. If the jsonType field of the document is of type <\/span><span style=\"font-size: 15px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: italic; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">player, <\/span><span style=\"font-size: 15px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">we emit the score of the player and the id.<\/span><\/b><\/p>\n<div style=\"background-color: transparent; color: rgb(0, 0, 0); font-family: Times; line-height: normal; font-size: medium; \"><b id=\"internal-source-marker_0.7206992749124765\" style=\"font-weight: normal; \"><span style=\"font-size: 13px; font-family: Verdana; color: rgb(0, 51, 102); background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">function<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(34, 34, 34); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \"> <\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(0, 153, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">(<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(34, 34, 34); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">doc<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(0, 153, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">)<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(34, 34, 34); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \"> <\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(0, 153, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">{<\/span><\/b><\/div>\n<div style=\"background-color: transparent; line-height: normal; \">\n<p dir=\"ltr\" style=\"color: rgb(0, 0, 0); font-family: Times; font-size: medium; text-align: justify; margin-top: 0pt; margin-bottom: 0pt; \"><b id=\"internal-source-marker_0.7206992749124765\" style=\"font-weight: normal; \"><span style=\"font-size: 13px; font-family: Verdana; color: rgb(34, 34, 34); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">\u00a0<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(0, 0, 102); background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">if<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(34, 34, 34); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \"> <\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(0, 153, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">(<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(34, 34, 34); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">doc.<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(102, 0, 102); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">jsonType<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(34, 34, 34); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \"> <\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(51, 153, 51); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">==<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(34, 34, 34); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \"> <\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(51, 102, 204); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">&#8220;player&#8221;<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(0, 153, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">){<\/span><\/b><\/p>\n<p dir=\"ltr\" style=\"color: rgb(0, 0, 0); font-family: Times; font-size: medium; text-align: justify; margin-top: 0pt; margin-bottom: 0pt; \"><b id=\"internal-source-marker_0.7206992749124765\" style=\"font-weight: normal; \"><span style=\"font-size: 13px; font-family: Verdana; color: rgb(34, 34, 34); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">\u00a0\u00a0\u00a0emit<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(0, 153, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">([<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(51, 102, 204); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">&#8220;Score&#8221;<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(51, 153, 51); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">,<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(34, 34, 34); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \"> \u00a0doc.<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(102, 0, 102); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">score<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(0, 153, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">]<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(51, 153, 51); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">,<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(34, 34, 34); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \"> doc._id<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(0, 153, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">)<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(51, 153, 51); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">;<\/span><\/b><\/p>\n<p dir=\"ltr\" style=\"color: rgb(0, 0, 0); font-family: Times; font-size: medium; text-align: justify; margin-top: 0pt; margin-bottom: 0pt; \"><b id=\"internal-source-marker_0.7206992749124765\" style=\"font-weight: normal; \"><span style=\"font-size: 13px; font-family: Verdana; color: rgb(34, 34, 34); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">\u00a0<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(0, 153, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">}<\/span><\/b><\/p>\n<p dir=\"ltr\" style=\"color: rgb(0, 0, 0); font-family: Times; font-size: medium; text-align: justify; margin-top: 0pt; margin-bottom: 0pt; \"><b id=\"internal-source-marker_0.7206992749124765\" style=\"font-weight: normal; \"><span style=\"font-size: 13px; font-family: Verdana; color: rgb(0, 153, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">}<\/span><\/b><\/p>\n<p><\/p>\n<div dir=\"ltr\" style=\"color: rgb(0, 0, 0); font-family: Times; font-size: medium; text-align: justify; margin-top: 0pt; margin-bottom: 0pt; \"><b id=\"internal-source-marker_0.7206992749124765\" style=\"font-weight: normal; \"><span style=\"font-size: 15px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">The map function above can be used to create a leaderboard of sorts. Well, it depends on how we query it. Views can be queried using the REST API or using other SDKs such as PHP.<\/span><\/b><\/div>\n<p><\/p>\n<ol style=\"color: rgb(0, 0, 0); font-family: Times; font-size: medium; margin-top: 0pt; margin-bottom: 0pt; \">\n<li style=\"list-style-type: decimal; font-size: 15px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; \">\n<p dir=\"ltr\" style=\"text-align: justify; margin-top: 0pt; margin-bottom: 0pt; \"><b id=\"internal-source-marker_0.7206992749124765\" style=\"font-weight: normal; \"><span style=\"font-size: 15px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">To <\/span><a href=\"https:\/\/www.couchbase.com\/docs\/couchbase-manual-2.0\/couchbase-views-querying-rest-api.html\"><span style=\"font-size: 15px; font-family: Arial; color: rgb(17, 85, 204); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap; \">query the view using REST<\/span><\/a><span style=\"font-size: 15px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \"> you can use the following curl command &#8211; <\/span><\/b><\/p>\n<\/li>\n<\/ol>\n<p><\/p>\n<p dir=\"ltr\" style=\"color: rgb(0, 0, 0); font-family: Times; font-size: medium; margin-left: 36pt; text-align: justify; margin-top: 0pt; margin-bottom: 0pt; \"><b id=\"internal-source-marker_0.7206992749124765\" style=\"font-weight: normal; \"><span style=\"font-size: 15px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">curl -X GET -H &#39;Content-Type: application\/json&#39; <\/span><\/b><\/p>\n<p dir=\"ltr\" style=\"color: rgb(0, 0, 0); font-family: Times; font-size: medium; margin-left: 36pt; margin-top: 0pt; margin-bottom: 0pt; \"><b id=\"internal-source-marker_0.7206992749124765\" style=\"font-weight: normal; \"><span style=\"font-size: 15px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">\u2018https:\/\/<\/span><span style=\"font-size: 15px; font-family: Arial; color: rgb(255, 0, 0); background-color: transparent; font-weight: normal; font-style: italic; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">bucketname<\/span><span style=\"font-size: 15px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">:<\/span><span style=\"font-size: 15px; font-family: Arial; color: rgb(255, 0, 0); background-color: transparent; font-weight: normal; font-style: italic; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">password<\/span><span style=\"font-size: 15px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">@<\/span><span style=\"font-size: 15px; font-family: Arial; color: rgb(255, 0, 0); background-color: transparent; font-weight: normal; font-style: italic; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">localhost<\/span><span style=\"font-size: 15px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">:8092\/<\/span><span style=\"font-size: 15px; font-family: Arial; color: rgb(255, 0, 0); background-color: transparent; font-weight: normal; font-style: italic; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">bucketname<\/span><span style=\"font-size: 15px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">\/_design\/<\/span><span style=\"font-size: 15px; font-family: Arial; color: rgb(255, 0, 0); background-color: transparent; font-weight: normal; font-style: italic; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">designdocname<\/span><span style=\"font-size: 15px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">\/_view\/<\/span><\/b><\/p>\n<p dir=\"ltr\" style=\"color: rgb(0, 0, 0); font-family: Times; font-size: medium; margin-left: 36pt; margin-top: 0pt; margin-bottom: 0pt; \"><b style=\"font-weight: normal; \"><span style=\"font-size: 15px; font-family: Arial; color: rgb(255, 0, 0); background-color: transparent; font-weight: normal; font-style: italic; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">viewname<\/span><\/b><b id=\"internal-source-marker_0.7206992749124765\" style=\"font-weight: normal; \"><span style=\"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-weight: normal; font-style: normal; font-size: 15px; font-family: Arial; vertical-align: baseline; color: rgb(0, 0, 0); background-color: transparent; font-variant: normal; text-decoration: none; white-space: pre-wrap; \">?<\/span><\/b><b style=\"font-weight: normal; \"><span style=\"font-size: 15px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">descending=true&#038;connection_timeout=60000&#038;limit=10&#038;skip=0<\/span><span style=\"font-size: 15px; font-family: Arial; color: rgb(255, 0, 0); background-color: transparent; font-weight: normal; font-style: italic; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">\u2019<\/span><\/b><\/p>\n<p><\/p>\n<ol start=\"2\" style=\"color: rgb(0, 0, 0); font-family: Times; font-size: medium; margin-top: 0pt; margin-bottom: 0pt; \">\n<li style=\"list-style-type: decimal; font-size: 15px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; \">\n<p dir=\"ltr\" style=\"text-align: justify; margin-top: 0pt; margin-bottom: 0pt; \"><b id=\"internal-source-marker_0.7206992749124765\" style=\"font-weight: normal; \"><span style=\"font-size: 15px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">To query the view using PHP you can use the code snippet as shown below and print out the top 10 player scores &#8211; \u00a0<\/span><\/b><\/p>\n<\/li>\n<\/ol>\n<p><\/p>\n<p dir=\"ltr\" style=\"color: rgb(0, 0, 0); font-family: Times; font-size: medium; margin-left: 36pt; text-align: justify; margin-top: 0pt; margin-bottom: 0pt; \"><b id=\"internal-source-marker_0.7206992749124765\" style=\"font-weight: normal; \"><span style=\"font-size: 13px; font-family: Verdana; color: rgb(102, 102, 102); background-color: transparent; font-weight: normal; font-style: italic; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">\/* Setup couchbase connection object *\/<\/span><\/b><\/p>\n<p dir=\"ltr\" style=\"color: rgb(0, 0, 0); font-family: Times; font-size: medium; margin-left: 36pt; text-align: justify; margin-top: 0pt; margin-bottom: 0pt; \"><b id=\"internal-source-marker_0.7206992749124765\" style=\"font-weight: normal; \"><span style=\"font-size: 13px; font-family: Verdana; color: rgb(0, 0, 136); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">$lbview<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(34, 34, 34); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \"> <\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(51, 153, 51); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">=<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(34, 34, 34); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \"> <\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(0, 0, 136); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">$cb<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(51, 153, 51); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">-><\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(0, 64, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">getView<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(0, 153, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">(<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(0, 0, 255); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">&#8220;<\/span><span style=\"font-size: 15px; font-family: Arial; color: rgb(255, 0, 0); background-color: transparent; font-weight: normal; font-style: italic; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">bucketname<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(0, 0, 255); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">&#8220;<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(51, 153, 51); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">,<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(34, 34, 34); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \"> <\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(0, 0, 255); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">&#8220;<\/span><span style=\"font-size: 15px; font-family: Arial; color: rgb(255, 0, 0); background-color: transparent; font-weight: normal; font-style: italic; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">viewname<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(0, 0, 255); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">&#8220;<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(0, 153, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">)<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(51, 153, 51); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">;<\/span><\/b><\/p>\n<p dir=\"ltr\" style=\"color: rgb(0, 0, 0); font-family: Times; font-size: medium; margin-left: 36pt; margin-top: 0pt; margin-bottom: 0pt; \"><b id=\"internal-source-marker_0.7206992749124765\" style=\"font-weight: normal; \"><span style=\"font-size: 13px; font-family: Verdana; color: rgb(0, 0, 136); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">$apage<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(51, 153, 51); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \"> = <\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(0, 0, 136); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">$lbview-><\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(0, 64, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">getResult<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(0, 153, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">(<\/span><a href=\"https:\/\/www.php.net\/array\"><span style=\"font-size: 13px; font-family: Verdana; color: rgb(153, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">array<\/span><\/a><span style=\"font-size: 13px; font-family: Verdana; color: rgb(0, 153, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">(<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(0, 0, 255); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">&#8220;descending&#8221;<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(34, 34, 34); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \"> <\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(51, 153, 51); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">=><\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(34, 34, 34); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \"> <\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(0, 153, 0); background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">true<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(0, 153, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">))<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(51, 153, 51); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">;<\/span><\/b><\/p>\n<p dir=\"ltr\" style=\"color: rgb(0, 0, 0); font-family: Times; font-size: medium; margin-left: 36pt; margin-top: 0pt; margin-bottom: 0pt; \"><b id=\"internal-source-marker_0.7206992749124765\" style=\"font-weight: normal; \"><span style=\"font-size: 13px; font-family: Verdana; color: rgb(0, 0, 136); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">$rowCtr<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(34, 34, 34); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \"> <\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(51, 153, 51); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">=<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(34, 34, 34); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \"> 0;<\/span><\/b><\/p>\n<p dir=\"ltr\" style=\"color: rgb(0, 0, 0); font-family: Times; font-size: medium; margin-left: 36pt; margin-top: 0pt; margin-bottom: 0pt; \"><b id=\"internal-source-marker_0.7206992749124765\" style=\"font-weight: normal; \"><span style=\"font-size: 13px; font-family: Verdana; color: rgb(177, 177, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">foreach<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(0, 153, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">(<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(0, 0, 136); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">$apage<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(51, 153, 51); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">-><\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(0, 64, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">rows<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(34, 34, 34); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \"> <\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(177, 177, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">AS<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(34, 34, 34); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \"> <\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(0, 0, 136); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">$row<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(0, 153, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">)<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(34, 34, 34); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \"> <\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(0, 153, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">{<\/span><\/b><\/p>\n<p dir=\"ltr\" style=\"color: rgb(0, 0, 0); font-family: Times; font-size: medium; margin-left: 36pt; margin-top: 0pt; margin-bottom: 0pt; \"><b id=\"internal-source-marker_0.7206992749124765\" style=\"font-weight: normal; \"><span style=\"font-size: 13px; font-family: Verdana; color: rgb(34, 34, 34); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">\u00a0<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(177, 177, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">if<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(0, 153, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">(<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(0, 0, 136); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">$rowCtr<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(51, 153, 51); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \"> <= <\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(34, 34, 34); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">9<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(0, 153, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">)<\/span><\/b><\/p>\n<p dir=\"ltr\" style=\"color: rgb(0, 0, 0); font-family: Times; font-size: medium; margin-left: 36pt; margin-top: 0pt; margin-bottom: 0pt; \"><b id=\"internal-source-marker_0.7206992749124765\" style=\"font-weight: normal; \"><span style=\"font-size: 13px; font-family: Verdana; color: rgb(51, 153, 51); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">\u00a0{<\/span><\/b><\/p>\n<p dir=\"ltr\" style=\"color: rgb(0, 0, 0); font-family: Times; font-size: medium; margin-left: 36pt; margin-top: 0pt; margin-bottom: 0pt; \"><b id=\"internal-source-marker_0.7206992749124765\" style=\"font-weight: normal; \"><span style=\"font-size: 13px; font-family: Verdana; color: rgb(51, 153, 51); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">\u00a0\u00a0<\/span><a href=\"https:\/\/www.php.net\/printf\"><span style=\"font-size: 13px; font-family: Verdana; color: rgb(153, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">printf<\/span><\/a><span style=\"font-size: 13px; font-family: Verdana; color: rgb(0, 153, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">(<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(0, 0, 255); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">&#8220;Score <\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(0, 153, 51); background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">%s<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(0, 0, 255); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \"> for user <\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(0, 153, 51); background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">%s<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(0, 0, 255); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">.<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(0, 0, 153); background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">n<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(0, 0, 255); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">&#8220;<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(51, 153, 51); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">,<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(34, 34, 34); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \"> <\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(0, 0, 136); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">$row<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(51, 153, 51); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">-><\/span><a href=\"https:\/\/www.php.net\/key\"><span style=\"font-size: 13px; font-family: Verdana; color: rgb(153, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">key<\/span><\/a><span style=\"font-size: 13px; font-family: Verdana; color: rgb(0, 153, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">[<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(204, 102, 204); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">1<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(0, 153, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">]<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(51, 153, 51); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">,<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(34, 34, 34); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \"> <\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(0, 0, 136); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">$row<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(51, 153, 51); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">-><\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(0, 64, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">value<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(0, 153, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">)<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(51, 153, 51); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">;<\/span><\/b><\/p>\n<p><\/p>\n<p dir=\"ltr\" style=\"color: rgb(0, 0, 0); font-family: Times; font-size: medium; margin-left: 36pt; margin-top: 0pt; margin-bottom: 0pt; \"><b id=\"internal-source-marker_0.7206992749124765\" style=\"font-weight: normal; \"><span style=\"font-size: 13px; font-family: Verdana; color: rgb(51, 153, 51); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">\u00a0\u00a0\u00a0<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(0, 0, 136); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">$rowCtr = $rowCtr + 1;<\/span><\/b><\/p>\n<p dir=\"ltr\" style=\"color: rgb(0, 0, 0); font-family: Times; font-size: medium; margin-left: 36pt; text-align: justify; margin-top: 0pt; margin-bottom: 0pt; \"><b id=\"internal-source-marker_0.7206992749124765\" style=\"font-weight: normal; \"><span style=\"font-size: 13px; font-family: Verdana; color: rgb(0, 153, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">\u00a0\u00a0}<\/span><\/b><\/p>\n<p dir=\"ltr\" style=\"color: rgb(0, 0, 0); font-family: Times; font-size: medium; margin-left: 36pt; text-align: justify; margin-top: 0pt; margin-bottom: 0pt; \"><b id=\"internal-source-marker_0.7206992749124765\" style=\"font-weight: normal; \"><span style=\"font-size: 15px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">\u00a0\u00a0\u00a0<\/span><span style=\"font-size: 13px; font-family: Verdana; color: rgb(177, 177, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">else<\/span><\/b><\/p>\n<p dir=\"ltr\" style=\"color: rgb(0, 0, 0); font-family: Times; font-size: medium; margin-left: 36pt; text-align: justify; margin-top: 0pt; margin-bottom: 0pt; \"><b id=\"internal-source-marker_0.7206992749124765\" style=\"font-weight: normal; \"><span style=\"font-size: 15px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0break;<\/span><\/b><\/p>\n<p><b id=\"internal-source-marker_0.7206992749124765\" style=\"color: rgb(0, 0, 0); font-family: Times; font-size: medium; font-weight: normal; \"><span style=\"font-size: 13px; font-family: Verdana; color: rgb(0, 153, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">}<\/span><\/b><\/p>\n<\/div>\n<p><b id=\"internal-source-marker_0.7206992749124765\" style=\"font-weight: normal; \"><span style=\"font-size: 24px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">Final Thoughts<\/span><\/b><\/p>\n<div><b id=\"internal-source-marker_0.7206992749124765\" style=\"font-family: Times; font-size: medium; font-weight: normal; \"><span style=\"font-size: 15px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">There\u2019s a bit of application code that has to occur here to translate the mapreduce view output into a useful format but in general crankin\u2019 out a leaderboard using Couchbase is super easy. I hope this helps someone utilize the new features of Couchbase Server 2.0 (views). For a more detailed look at views, see the docs : https:\/\/www.couchbase.com\/docs\/couchbase-manual-2.0\/couchbase-views.html <\/span><\/b><\/div>\n<div style=\"background-color: transparent; color: rgb(0, 0, 0); line-height: normal; \"><b id=\"internal-source-marker_0.7206992749124765\" style=\"font-weight: normal; \"><span style=\"font-size: 15px; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; \">Game On!<\/span><\/b><\/div>\n","protected":false},"excerpt":{"rendered":"<p>What\u2019s in a new social game? Fundamentally, a game is an \u201cexperience\u201d built around a series of interactions between the player, the content, and other players. Sure, the concept of the game, the storyline, the characters, and social components all [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":13873,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[1],"tags":[],"ppma_author":[8972],"class_list":["post-1840","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.3 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Working with social game entities in Couchbase - The Couchbase Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.couchbase.com\/blog\/pt\/working-social-game-entities-couchbase\/\" \/>\n<meta property=\"og:locale\" content=\"pt_BR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Working with social game entities in Couchbase\" \/>\n<meta property=\"og:description\" content=\"What\u2019s in a new social game? Fundamentally, a game is an \u201cexperience\u201d built around a series of interactions between the player, the content, and other players. Sure, the concept of the game, the storyline, the characters, and social components all [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/pt\/working-social-game-entities-couchbase\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:published_time\" content=\"2014-12-16T17:37:09+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2022\/11\/couchbase-nosql-dbaas.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1800\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Don Pinto, Principal Product Manager, Couchbase\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Don Pinto, Principal Product Manager, Couchbase\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutos\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/working-social-game-entities-couchbase\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/working-social-game-entities-couchbase\\\/\"},\"author\":{\"name\":\"Don Pinto, Principal Product Manager, Couchbase\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#\\\/schema\\\/person\\\/eb130a1e0278989e089a7fbbf8bc754c\"},\"headline\":\"Working with social game entities in Couchbase\",\"datePublished\":\"2014-12-16T17:37:09+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/working-social-game-entities-couchbase\\\/\"},\"wordCount\":797,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/working-social-game-entities-couchbase\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/1\\\/2022\\\/11\\\/couchbase-nosql-dbaas.png\",\"articleSection\":[\"Uncategorized\"],\"inLanguage\":\"pt-BR\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/working-social-game-entities-couchbase\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/working-social-game-entities-couchbase\\\/\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/working-social-game-entities-couchbase\\\/\",\"name\":\"Working with social game entities in Couchbase - The Couchbase Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/working-social-game-entities-couchbase\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/working-social-game-entities-couchbase\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/1\\\/2022\\\/11\\\/couchbase-nosql-dbaas.png\",\"datePublished\":\"2014-12-16T17:37:09+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/working-social-game-entities-couchbase\\\/#breadcrumb\"},\"inLanguage\":\"pt-BR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/working-social-game-entities-couchbase\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/working-social-game-entities-couchbase\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/1\\\/2022\\\/11\\\/couchbase-nosql-dbaas.png\",\"contentUrl\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/1\\\/2022\\\/11\\\/couchbase-nosql-dbaas.png\",\"width\":1800,\"height\":630},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/working-social-game-entities-couchbase\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Working with social game entities in Couchbase\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/\",\"name\":\"The Couchbase Blog\",\"description\":\"Couchbase, the NoSQL Database\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"pt-BR\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#organization\",\"name\":\"The Couchbase Blog\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/04\\\/admin-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/04\\\/admin-logo.png\",\"width\":218,\"height\":34,\"caption\":\"The Couchbase Blog\"},\"image\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#\\\/schema\\\/person\\\/eb130a1e0278989e089a7fbbf8bc754c\",\"name\":\"Don Pinto, Principal Product Manager, Couchbase\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/574759a111515cb8c5d5a1f5268d2759050bd8383654dc0d9393324f0c35fae0?s=96&d=mm&r=g39c6d6178c73f0dc09af63f930a4f37d\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/574759a111515cb8c5d5a1f5268d2759050bd8383654dc0d9393324f0c35fae0?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/574759a111515cb8c5d5a1f5268d2759050bd8383654dc0d9393324f0c35fae0?s=96&d=mm&r=g\",\"caption\":\"Don Pinto, Principal Product Manager, Couchbase\"},\"description\":\"Don Pinto is a Principal Product Manager at Couchbase and is currently focused on advancing the capabilities of Couchbase Server. He is extremely passionate about data technology, and in the past has authored several articles on Couchbase Server including technical blogs and white papers. Prior to joining Couchbase, Don spent several years at IBM where he maintained the role of software developer in the DB2 information management group and most recently as a program manager on the SQL Server team at Microsoft. Don holds a master's degree in computer science and a bachelor's in computer engineering from the University of Toronto, Canada.\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/pt\\\/author\\\/don-pinto\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Working with social game entities in Couchbase - The Couchbase Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.couchbase.com\/blog\/pt\/working-social-game-entities-couchbase\/","og_locale":"pt_BR","og_type":"article","og_title":"Working with social game entities in Couchbase","og_description":"What\u2019s in a new social game? Fundamentally, a game is an \u201cexperience\u201d built around a series of interactions between the player, the content, and other players. Sure, the concept of the game, the storyline, the characters, and social components all [&hellip;]","og_url":"https:\/\/www.couchbase.com\/blog\/pt\/working-social-game-entities-couchbase\/","og_site_name":"The Couchbase Blog","article_published_time":"2014-12-16T17:37:09+00:00","og_image":[{"width":1800,"height":630,"url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2022\/11\/couchbase-nosql-dbaas.png","type":"image\/png"}],"author":"Don Pinto, Principal Product Manager, Couchbase","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Don Pinto, Principal Product Manager, Couchbase","Est. reading time":"4 minutos"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/working-social-game-entities-couchbase\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/working-social-game-entities-couchbase\/"},"author":{"name":"Don Pinto, Principal Product Manager, Couchbase","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/eb130a1e0278989e089a7fbbf8bc754c"},"headline":"Working with social game entities in Couchbase","datePublished":"2014-12-16T17:37:09+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/working-social-game-entities-couchbase\/"},"wordCount":797,"commentCount":2,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/working-social-game-entities-couchbase\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","articleSection":["Uncategorized"],"inLanguage":"pt-BR","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/working-social-game-entities-couchbase\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/working-social-game-entities-couchbase\/","url":"https:\/\/www.couchbase.com\/blog\/working-social-game-entities-couchbase\/","name":"Working with social game entities in Couchbase - The Couchbase Blog","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/working-social-game-entities-couchbase\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/working-social-game-entities-couchbase\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","datePublished":"2014-12-16T17:37:09+00:00","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/working-social-game-entities-couchbase\/#breadcrumb"},"inLanguage":"pt-BR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/working-social-game-entities-couchbase\/"]}]},{"@type":"ImageObject","inLanguage":"pt-BR","@id":"https:\/\/www.couchbase.com\/blog\/working-social-game-entities-couchbase\/#primaryimage","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","width":1800,"height":630},{"@type":"BreadcrumbList","@id":"https:\/\/www.couchbase.com\/blog\/working-social-game-entities-couchbase\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Working with social game entities in Couchbase"}]},{"@type":"WebSite","@id":"https:\/\/www.couchbase.com\/blog\/#website","url":"https:\/\/www.couchbase.com\/blog\/","name":"Blog do Couchbase","description":"Couchbase, o banco de dados NoSQL","publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.couchbase.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"pt-BR"},{"@type":"Organization","@id":"https:\/\/www.couchbase.com\/blog\/#organization","name":"Blog do Couchbase","url":"https:\/\/www.couchbase.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"pt-BR","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png","width":218,"height":34,"caption":"The Couchbase Blog"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/eb130a1e0278989e089a7fbbf8bc754c","name":"Don Pinto, gerente principal de produtos da Couchbase","image":{"@type":"ImageObject","inLanguage":"pt-BR","@id":"https:\/\/secure.gravatar.com\/avatar\/574759a111515cb8c5d5a1f5268d2759050bd8383654dc0d9393324f0c35fae0?s=96&d=mm&r=g39c6d6178c73f0dc09af63f930a4f37d","url":"https:\/\/secure.gravatar.com\/avatar\/574759a111515cb8c5d5a1f5268d2759050bd8383654dc0d9393324f0c35fae0?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/574759a111515cb8c5d5a1f5268d2759050bd8383654dc0d9393324f0c35fae0?s=96&d=mm&r=g","caption":"Don Pinto, Principal Product Manager, Couchbase"},"description":"Don Pinto \u00e9 gerente de produto principal da Couchbase e atualmente est\u00e1 concentrado no avan\u00e7o dos recursos do Couchbase Server. Ele \u00e9 extremamente apaixonado por tecnologia de dados e, no passado, foi autor de v\u00e1rios artigos sobre o Couchbase Server, incluindo blogs t\u00e9cnicos e white papers. Antes de ingressar no Couchbase, Don passou v\u00e1rios anos na IBM, onde ocupou a fun\u00e7\u00e3o de desenvolvedor de software no grupo de gerenciamento de informa\u00e7\u00f5es DB2 e, mais recentemente, como gerente de programa na equipe do SQL Server na Microsoft. Don tem mestrado em ci\u00eancia da computa\u00e7\u00e3o e \u00e9 bacharel em engenharia da computa\u00e7\u00e3o pela Universidade de Toronto, no Canad\u00e1.","url":"https:\/\/www.couchbase.com\/blog\/pt\/author\/don-pinto\/"}]}},"acf":[],"authors":[{"term_id":8972,"user_id":4,"is_guest":0,"slug":"don-pinto","display_name":"Don Pinto, Principal Product Manager, Couchbase","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/574759a111515cb8c5d5a1f5268d2759050bd8383654dc0d9393324f0c35fae0?s=96&d=mm&r=g","0":null,"1":"","2":"","3":"","4":"","5":"","6":"","7":"","8":""}],"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/posts\/1840","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/comments?post=1840"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/posts\/1840\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/media\/13873"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/media?parent=1840"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/categories?post=1840"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/tags?post=1840"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/pt\/wp-json\/wp\/v2\/ppma_author?post=1840"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}