pgte / alfred

Node is your mansion, Alfred is your butler. Node.js key-value store
http://pgte.github.com/alfred/
MIT License
149 stars 10 forks source link

issues #13, #14 and #15 #16

Open sergioramos opened 12 years ago

sergioramos commented 12 years ago

Issue #13

I didn't found any reference to the variable value, so i just deleted and everything worked as expected.

Issue #14

Instead of returning a stream, it calls the callback whith the stream as parameter.

So, insted of

var stream = article.find({date: {$range: {$start: null, $end: null}}}).stream();

stream.on('record', function(record) {
  console.log(record);
});
stream.on('error', function(err) {
  throw(err);
});
stream.on('end', function() {
  console.log('ended');
});

it should now be

article.find({date: {$range: {$start: null, $end: null}}}).stream(function (stream) {   
    stream.on('record', function(record) {
      console.log(record);
    });
    stream.on('error', function(err) {
      throw(err);
    });
    stream.on('end', function() {
      console.log('ended');
    });
});

Issue #15

Tried array.map and proccess.nextTick to prevent the RangeError, but only worked using async's forEachSeries