New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Length extends beyond buffer #39
Comments
I had this problem as well. Did you edit your .db file manually? I noticed that this problem occurs if you have empty lines in the file; e.g. an empty line at the beginning, or you delete some entries manually and leave your cursor at the beginning of the last -now empty- line instead of at the end of the last populated line upon saving. |
No I didn't edit db file manually. I can replicate the issue with my this db: and followin testing code var nStore = require('nstore');
nStore = nStore.extend(require('nstore/query')());
var provider = nStore.new('provider.db', function () {
console.log('DB provider loaded');
provider.all(function (err, results) {
if (err) console.log(err);
else {
console.log(results);
results.forEach(function(result) {
console.log(result);
});
}
});
}); |
I took a quick look at your file and there is definitely something wrong with it; if you have an editor that shows line numbers, you'll see there is a line (25) starting with "photo" instead of a dbase key (after "were_here_count":3383 ). Normally, new lines start with a key. And in your test code, results is a single object (its keys are the dbase keys) so forEach won't work. for(var key in results){
console.log(results[key]);
} So now your problem is reduced to finding out how your db file got corrupt :-) |
You're right. Right now i'm investigating what caused the wrong data was written. |
Hi, I'm storing results of Google Maps Places search and also Facebook Places into nStore.
But after some time I get following error:
version of nStore: 0.5.2
The text was updated successfully, but these errors were encountered: