Ivshti / linvodb3

Persistent database for Node.js/NW.js/Electron with MongoDB/Mongoose-like features and interface on top of LevelUp

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`Unhandled rejection ReadError: get() requires key and callback arguments`

harryparkdotio opened this issue · comments

Unhandled rejection ReadError: get() requires key and callback arguments
    at readError (~/Development/git/tapedeck/node_modules/LinvoDB3/node_modules/levelup/lib/levelup.js:175:21)
    at LevelUP.get (~/Development/git/tapedeck/node_modules/LinvoDB3/node_modules/levelup/lib/levelup.js:187:12)
    at Function.Cursor.retriever (~/Development/git/tapedeck/node_modules/LinvoDB3/lib/cursor.js:355:17)
    at ~/Development/git/tapedeck/node_modules/LinvoDB3/lib/cursor.js:332:16
    at Timeout._onTimeout (~/Development/git/tapedeck/node_modules/LinvoDB3/node_modules/bagpipe/lib/bagpipe.js:157:34)
    at ontimeout (timers.js:469:11)
    at tryOnTimeout (timers.js:304:5)
    at Timer.listOnTimeout (timers.js:264:5)

This is the error returned when trying to find documents; Track.find({}, (err, docs) => { console.log(err, docs)});


import LinvoDB from 'LinvoDB3';

LinvoDB.defaults.store = { db: require('leveldown') };
LinvoDB.dbPath = '/Users/harryparkdotio/Desktop';

const Track = new LinvoDB('tracks', {
	artistId: String,
	artist: String,
	albumId: String,
	album: String,
	title: String,
	duration: String,
	no: String,
	format: String,
	bitrate: Number,
	releaseID: String,
	path: String
});

I was putting promises into the db by accident.

Lol :) Well thanks for the update!

Could this be something that is better taken care of? Say, throw a specific error?