在MongoDB中查找不符合联系的logging

我需要通过一个条件来find方法。 但是用比较运算符!= 。 在MongoDB中可能吗? 我在文档运算符中看到像ANDOR&lt ; &gt ,但是否定运算符。 你有任何想法如何获取所有的logging,该recordType不等于Message

 collection.find({'recordType' : 'Message'}).toArray(function(err, results) { // <-- need NOT EQUAL OPERATOR }); 

$ne是解决scheme。

语法: {field: {$ne: value} }

$neselect字段值not equal (ie !=)到指定值的文档。 这包括不包含该字段的文档。

 collection.find({'recordType' : {'$ne' : 'Message'}}).toArray(function(err, results) { console.log(results); }); 

请参阅文档以了解如何使用它。