我尝试了很多技巧来获取mongodb _id的值,但所有这些都会导致错误。我想这些:无法获得mongodb _id值在php
$new_id = new MongoId();
print_r($new_id['_id']); // -> Internal Server Error
echo $new_id['_id']->{'$id'}; // -> Internal Server Error
print_r($new_id); // no error, but useless
所以,我不知道怎么做是正确的
检查你的服务器错误日志 – khartnett 2015-01-26 19:41:49
“致命错误:不能使用MongoId类型的对象作为数组...” – Jacobian 2015-01-26 19:44:11