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
import json | |
import sys | |
filename = sys.argv[1] | |
data = json.load(open(str(filename))) | |
for i in range(0, len(data)): | |
treeid = data[i]['TREE_ID'] | |
outfile = open('./output/' + str(treeid) + '.json', 'w') | |
json.dump(data[i], outfile) | |
outfile.close() |
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> |
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> |
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
Dons-MacBook-Pro:tools don$ pwd | |
/Applications/Couchbase Server.app/Contents/Resources/couchbase-core/bin/tools | |
Dons-MacBook-Pro:tools don$ ./cbworkloadgen -n localhost:8091 | |
[####################] 100.0% (10527/10526 msgs) | |
bucket: default, msgs transferred... | |
: total | last | per sec | |
batch : 11 | 11 | 18.6 | |
byte : 105270 | 105270 | 177716.4 | |
msg : 10527 | 10527 | 17771.6 | |
done |
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
Dons-MacBook-Pro:tools don$ pwd | |
/Applications/Couchbase Server.app/Contents/Resources/couchbase-core/bin/tools | |
Dons-MacBook-Pro:tools don$ ./cbworkloadgen -n localhost:8091 | |
[####################] 100.0% (10527/10526 msgs) | |
bucket: default, msgs transferred... | |
: total | last | per sec | |
batch : 11 | 11 | 18.6 | |
byte : 105270 | 105270 | 177716.4 | |
msg : 10527 | 10527 | 17771.6 | |
done |
OlderNewer