Skip to content

Instantly share code, notes, and snippets.

View kilaulena's full-sized avatar

Lena Herrmann kilaulena

  • Zalando Marketing Services
  • Berlin, Germany
  • X @kilaulena
View GitHub Profile
in the model:
puts "-------------------------------------------------------------------------------"
puts "we have #{Place.published.tagged.count} tagged published places"
result:
describe 'copyDoc'
before_each
doc = {"Name" : "Sharon Agathon", "Callsign" : "Athena", "_id" : "123"};
db.saveDoc(doc);
end
it 'should result in another document with same data and new id'
db.copyDoc({_id: "123"}, {
success: function(resp){
console.log(resp, 'resp copyDoc')
// before:
function ajax(obj, options, errorMessage, ajaxOptions) {
options = $.extend({successStatus: 200}, options);
errorMessage = errorMessage || "Unknown error";
$.ajax($.extend($.extend({
type: "GET", dataType: "json",
complete: function(req) {
var resp = $.httpData(req, "json");
db = $.couch.db("spec_db");
db.create();
db.saveDoc({'type':'battlestar', 'name':'galactica'});
db2 = $.couch.db("spec_db_2");
host = window.location.protocol + "//" + window.location.host;
$.couch.replicate(host + db.uri, host + db2.uri, {
body : {"create_target":true},
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
**********************************************************************
Done. The new package has been installed and saved to
/couchdb/json-c_0.7-1_i386.deb
You can remove it from your system anytime using:
dpkg -r json-c