Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[minor] clean up comments.

  • Loading branch information...
commit ca37830c7fed165dd4a083305f4b815d76c88f54 1 parent 72e2c45
@chjj chjj authored
Showing with 3 additions and 24 deletions.
  1. +3 −24 lib/winston-mongodb.js
View
27 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;
Please sign in to comment.
Something went wrong with that request. Please try again.