db.collection('session').remove({timestamp:{'$lte':a}},function(err, docs) {
console.log(err)
console.log(docs)
});
Asked
Active
Viewed 1,404 times
2

Armen Grigoryan
- 521
- 2
- 9
-
It worked fine when I tried it. Can you edit your question to show an example doc and the contents of `a`. – JohnnyHK Oct 30 '14 at 13:25
2 Answers
0
I also faced similar issue with some downloaded code- shell worked properly but Node driver failed (there was no other external library like mongoose). My installed MongoDB version was 2.6.6 and the package.json had a mongodb entry as "~1.3.18". With a suggestion from someone, I changed the entry value to "~1.4.31" which resolved my problem.

CHEMBETI ARAVIND
- 91
- 1
- 11
-1
Remove the quotes around $lte
. It is not a key, but a directive.

Markus W Mahlberg
- 19,711
- 6
- 65
- 89
-
1Actually, it _is_ just a key in a JavaScript object at that point, so it doesn't matter. – JohnnyHK Oct 31 '14 at 03:23
-
-
http://stackoverflow.com/questions/4348478/what-is-the-difference-between-object-keys-with-quotes-and-without-quotes – JohnnyHK Oct 31 '14 at 12:48