This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function (doc) { | |
if(doc.type != null && doc.type == 'usersession') { | |
if(doc.location != null && doc.location == 'Toronto, Canada') { | |
emit(doc._id, doc.username) | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Key: user:<SESSION-IDENTIFIER> | |
{ | |
"type": "usersession", | |
"username": "dpinto", | |
"lastSeen": "<timestamp>", | |
"ipAddress": "<ipaddr>", | |
"location": "Toronto, Canada", | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Key: user:<SESSION-IDENTIFIER> | |
{ | |
"type": "usersession", | |
"username": "dpinto", | |
"lastSeen": "<timestamp>", | |
"ipAddress": "<ipaddr>", | |
"location": "Toronto, Canada", | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<module type="PYTHON_MODULE" version="4"> | |
<component name="NewModuleRootManager"> | |
<content url="file://$MODULE_DIR$" /> | |
<orderEntry type="inheritedJdk" /> | |
<orderEntry type="sourceFolder" forTests="false" /> | |
</component> | |
</module> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'couchbase' | |
connection = Couchbase.connect(options) | |
ddoc = connection.design_docs[options[:design_document]] | |
view = ddoc.send(options[:view]) | |
connection.run do | |
view.each(:group => true) do |doc| | |
dup_num = doc.value.size | |
if dup_num > 1 | |
puts "left doc #{doc.value[0]}, " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function (doc, meta) { | |
emit(doc1.foo); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function (doc, meta) { | |
if(doc1 && doc1.foo) | |
{ | |
emit(doc1.foo); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function (doc, meta){ | |
if(doc1 && doc1.foo){ | |
emit(doc1.foo); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function (doc, meta) { | |
// produce a time-based linear sequence of keys | |
var st_seconds = parseInt(parseInt(doc.start_time) / 1000); | |
var st_milliseconds = parseInt(doc.start_time) - (st_seconds * 1000); | |
var st_minutes = parseInt(st_seconds / 60 % 60); | |
var st_hours = parseInt(st_seconds / 60 / 60); | |
st_seconds = st_seconds % 60; | |
var sd_year = parseInt(doc.start_date.substr(0, 4)); | |
var sd_month = parseInt(doc.start_date.substr(4, 2)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript" id="cloudify-widget" data-api-key="2850beaa-9414-460c-b1e1-1e15b429c53a" data-title="Launch CouchBase 2.0" data-host="launch.cloudifysource.org" data-video_url="http://www.youtube.com/embed/VkQ3ppHeGX4" src="http://launch.cloudifysource.org/js/get_widget.js"></script> |
OlderNewer