git ssb

0+

Dominic / flumeview-level



Commit 17e4176fe606e91d0b3ce1a45ba33e4c8e27c9a2

make readme example true

Dominic Tarr committed on 11/22/2016, 10:07:15 PM
Parent: e1f08b9f6b33bcbfe8d6b98aa85d9c0c6c3d5379

Files changed

README.mdchanged
README.mdView
@@ -3,26 +3,35 @@
33 A flumeview implemented on top of level.
44
55 Provides indexes which are persistent and can be streamed in order.
66
7-Work In Progress.
87
98 ## example
109
1110 ``` js
1211 flumedb.use(name, function (value) {
13- return data.foo
12 + return [data.foo] // must return an array
1413 })
1514
1615 flumedb.append({foo: 'bar'}, function (err) {
1716 if(err) throw err
18- flumedb.get('bar', function (err, value) {
17 +
18 + //query items from the index directly
19 + flumedb[name].get('bar', function (err, value) {
1920 if(err) throw err
2021 console.log(value) // => {foo: 'bar'})
2122 })
23 +
24 + //or query ranges via pull-streams
25 + pull(
26 + flumedb[name].read({gte: 'bar', live: true}),
27 + ...
28 + )
29 +
2230 })
2331 ```
2432
2533 ## License
2634
2735 MIT
2836
37 +

Built with git-ssb-web