I am currently testing a sample database and my query wasn't returning anything until I placed the (+) character prior to the variable holding the integer value in my $gt query operator. Please shed some insight.
var mongo = require('mongodb').MongoClient;
var age = process.argv[2];
// console.log(process.argv);
var url = 'mongodb://localhost:27017/learnyoumongo';
mongo.connect(url, function(err, db){
if (err) throw err;
var parrots = db.collection('parrots');
parrots.count({
"age": {$gt: +age} // What does (+) do?
}, function(err, data){
if (err) throw err;
console.log(data);
db.close();
});
});