或者和并且

case1 OR ( [case2 AND case3] OR [case4 AND case5] )

You can try to use the $or operator:

db.hg19_refgene_47.find({
  $or: [
    "_id.c" : 1,
    {
      "_id.p" : {"$gte" : 96978}, 
      "_id.ep" : {"$lte" : 103632}
    },
    {
      "_id.p" : {"$gte" : 96978}, 
      "_id.ep" : {"$lte" : 103632}
    },
    {
      "_id.p" : {"$gte" : 96978}, 
      "_id.ep" : {"$lte" : 103632}
    }
  ]
})

猜你喜欢

转载自wang-peng1.iteye.com/blog/1973288