1
这是我在PHP如何使用php从mongodb表中检索数据?
public function showData(){
$m = new MongoClient();
$db = $m->newdb;
$collection = $db->createCollection("signup");
$data = $collection->find();
echo "asdf<pre>";print_r($data);exit;
}
代码,但它返回一个空数组,而我可以看到在外壳中的数据。我们可以通过写命令db.signup.find().forEach(printjson);