我使用mongodb的find()函数以下列格式从集合中获取记录
Array
(
[_id] => MongoId Object
(
[$id] => 52a9b86578e9288a378b4567
)
[0] => Array
(
[senderID] => 1
[followingID] => 15
[type] => TW
)
[1] => Array
(
[senderID] => 1
[followingID] => 16
[type] => TW
)
[2] => Array
(
[senderID] => 1
[followingID] => 17
[type] => TW
)
[3] => Array
(
[senderID] => 2
[followingID] => 17
[type] => TW
)
)
现在我想要所有发送ID为2的记录。我试过在find函数中传递数组
$myarray("senderID"=> 1)
$collection->find($myarray)
但它无法获得正确的记录。