Created
August 23, 2015 17:18
-
-
Save crtr0/5736893947020aa02116 to your computer and use it in GitHub Desktop.
Insert a document with a compound key using sublevel, and try to read it out.
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
var Sublevel = require('level-sublevel') | |
, Levelup = require('levelup') | |
, bytewise = require('bytewise') | |
var db = Sublevel(Levelup('./db', {keyEncoding: bytewise, valueEncoding: 'json'})) | |
var foo = db.sublevel('foo') | |
foo.put(['carter', 'rabasa'], {eyes: 'brown'}, function(err) { | |
foo.createReadStream().on('data', console.log) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment