-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.js
24 lines (22 loc) · 895 Bytes
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
var levelup = require('levelup');
var riakdown = require('riakdown');
var concat = require('concat-stream');
var db = levelup('riak://localhost:8087/default', {db: riakdown, valueEncoding: 'json'});
db.put('testkey', '{"name": "ham"}', {indexes: [{key: 'name_bin', value: 'ham'}], bucket: 'default'}, function (err, extra) {
db.createReadStream({
index: 'name_bin',
start: 'ham',
end: 'ham',
bucket: 'default'
}).pipe(concat(function (results) {
db.put('testkey', '{"name": "salami"}', {indexes: [{key: 'name_bin', value: 'salami'}], bucket: 'default', vclock: extra.vclock}, function (err) {
db.createReadStream({
index: 'name_bin',
start: 'ham',
end: 'ham',
bucket: 'default'
}).pipe(concat(function (results2) {
}));
});
}));
});