db/append.js
function appendModel(url, model, done){
		var list = utils.flatten_tree(JSON.parse(JSON.stringify(model)))

		var errormodel = null

		list = list.filter(function(model){
			if(!model._digger.path || !model._digger.inode){
				errormodel = model;
				return false;
			}
			return true
		})

		if(errormodel){
			return done('no path or inode in level-append: ' + JSON.stringify(model))
		}

		var batch = list.map(function(model){
			return {
				type:'put',
				key:model._digger.path + '/' + model._digger.inode,
				value:model
			}
		})

		tree.batch(batch, function(err){
			if(err) return done(err)
			done(null, model)
		})
	}
function appendModel(url, model, done){
		var list = utils.flatten_tree(JSON.parse(JSON.stringify(model)))

		var errormodel = null

		list = list.filter(function(model){
			if(!model._digger.path || !model._digger.inode){
				errormodel = model;
				return false;
			}
			return true
		})

		if(errormodel){
			return done('no path or inode in level-append: ' + JSON.stringify(model))
		}

		var batch = list.map(function(model){
			return {
				type:'put',
				key:model._digger.path + '/' + model._digger.inode,
				value:model
			}
		})

		tree.batch(batch, function(err){
			if(err) return done(err)
			done(null, model)
		})
	}
function appendModel ( url , model , done ) { var list = utils . flatten_tree ( JSON . parse ( JSON . stringify ( model ) ) ) var errormodel = null list = list . filter ( function ( model ) { if ( ! model . _digger . path || ! model . _digger . inode ) { errormodel = model ; return false ; } return true } ) if ( errormodel ) { return done ( 'no path or inode in level-append: ' + JSON . stringify ( model ) ) } var batch = list . map ( function ( model ) { return { type : 'put' , key : model . _digger . path + '/' + model . _digger . inode , value : model } } ) tree . batch ( batch , function ( err ) { if ( err ) return done ( err ) done ( null , model ) } ) }
append a single model
append a single model