2013-08-18 23 views
0

如何用mongoid寫下面的mongodb查詢?如何用mongoid實現如下查詢

db.messages.find({  
                        $or :[ 
        { $and : [ 
                                          {"receiver_id":"[email protected]"}, 
                                          {"sender_id":"[email protected]"} 
                               ] 
        }, 
                               { $and : [ 
          {"receiver_id":"[email protected]"}, 
          {"sender_id":"[email protected]"} 
        ]   
        } 
       ] 
      }); 

回答