From ca37830c7fed165dd4a083305f4b815d76c88f54 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Thu, 17 May 2012 12:12:06 -0500 Subject: [PATCH] [minor] clean up comments. --- lib/winston-mongodb.js | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-) diff --git a/lib/winston-mongodb.js b/lib/winston-mongodb.js index 57c4580..5783bb4 100644 --- a/lib/winston-mongodb.js +++ b/lib/winston-mongodb.js @@ -172,17 +172,10 @@ MongoDB.prototype.query = function (options, callback) { var self = this, options = this.normalizeQuery(options), - query = {}, - opt = {}, + query, + opt, fields; - // if (options.fields) { - // fields = {}; - // options.fields.forEach(function (key) { - // fields[key] = 1; - // }); - // } - query = { timestamp: { $gte: options.from, @@ -191,21 +184,12 @@ MongoDB.prototype.query = function (options, callback) { }; opt = { - // .skip(options.start) skip: options.start, - // .limit(options.rows) limit: options.rows, - // .sort({timestamp: -1}) sort: { timestamp: options.order === 'desc' ? -1 : 1 } }; - // if (fields) { - // // col.find({}, {field: 1}, {}) - // opt.fields = fields; - // } - if (options.fields) { - // col.find({}, {field: 1}, {}) opt.fields = options.fields; } @@ -250,10 +234,6 @@ MongoDB.prototype.stream = function (options, stream) { start = null; } - if (start == null) { - ; // get collection size - } - var opt = { skip: start || 0, tailable: true @@ -270,6 +250,7 @@ MongoDB.prototype.stream = function (options, stream) { // next(); // }); + // TODO: implement start // if (start == null) { // col.count({}, function (err, count) { // opt.skip = count; @@ -277,7 +258,6 @@ MongoDB.prototype.stream = function (options, stream) { // }); // } - // .sort({ $natural: 1 }) var cursor = col.find({}, opt); // tail cursor @@ -299,7 +279,6 @@ MongoDB.prototype.stream = function (options, stream) { // hack because isCapped doesn't work if (err.message === 'tailable cursor requested on non capped collection') { - //if (~(err.message + '').indexOf('non capped collection')) { tail.destroy(); self.streamPoll(options, stream); return;