Skip to content

Instantly share code, notes, and snippets.

@frank06 frank06/test.js
Created Nov 18, 2010

Embed
What would you like to do?
var db = require('riak-js').getClient(),
assert = require('assert'),
buf1 = new Buffer('bloooooo lala lalala lalala lala lalala lalala lala lalala lalala lala lalala lalala lala uuuuuuhhhh'),
buf2 = new Buffer('THIS ONLY OVERWRITES THE FIRST 40 BYTES')
db.saveLarge('text3', buf1, function(err, data, meta) {
// first save callback, wait for 1 sec
setTimeout(function() {
db.saveLarge('text3', buf2, meta, function(err) {
// second save callback, wait for 1 sec
setTimeout(function() {
db.getLarge('text3', function(err, data) {
// first read callback, assert data is what was saved last
assert.equal(data.toString(), buf2.toString())
})
}, 1000)
})
}, 1000)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.