How should such sql statements be checked with mongo queries?

  mongodb, question

select
*
from post
WHERE ip ! = 2130706433
AND ip ! = 0
AND ip ! = 2139062143
AND ip ! = 127
AND (ip < 2130706432 || ip > 2147483647)
AND (ip < 167772160 || ip > 184549375)
AND (valid = 1)
The array I used is this
$criteria = array(
‘valid’=>1,
‘ip’ => array(
array(‘$nin’ => array(2130706433,0,127,2139062143)),
array(‘$or’ => array(array(‘$gt’ => 2147483647), array(‘$lt’ => 2130706432)))
array(‘$or’ => array(array(‘$gt’ => 184549375), array(‘$lt’ => 167772160)))
)
);
But it didn’t work.

It seems that your query is correct to see if there is any data that meets the conditions.