V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
V2EX 提问指南
woshicixide
V2EX  ›  问与答

请教各位大神,这样的 sql 语句用 mongo 查询应该怎么查?

  •  
  •   woshicixide · 2014-12-30 11:48:57 +08:00 · 2288 views
    This topic created in 3620 days ago, the information mentioned may be changed or developed.
    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)
    我用的数组是这样的
    $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)))
    )
    );
    但是没用
    No Comments Yet
    About   ·   Help   ·   Blog   ·   API   ·   FAQ   ·   Tools   ·   5921 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 06:26 · PVG 14:26 · LAX 22:26 · JFK 01:26
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.