PHP Mongo查询NOT NULL [英] PHP Mongo Query NOT NULL
本文介绍了PHP Mongo查询NOT NULL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
任何人都知道编写php-mongo查询以使用NOT NULL
的语法吗?
Anyone know the syntax for writing a php-mongo query to use NOT NULL
?
当我查询NULL
时,我知道该怎么做:
I know how to do this when I query for NULL
:
<?php
$cursor = $collection->find(array("someField" => null));
这有可能吗?
推荐答案
是的,您需要$ne
运算符,所以
Yeah, you want the $ne
operator, so
$cursor = $collection->find(array("someField" => array('$ne' => null)));
这篇关于PHP Mongo查询NOT NULL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文