yum -y install mongodb mongodb-devel mongodb-server php-pecl-mongo
mydb;
$collection = $db->mycol;
$document = array(
"title" => "测试标题",
"description" => "mongodb",
"likes" => 100,
"url" => "imlee.top"
);
$collection->insert($document);
$cursor = $collection->find();
foreach($cursor as $dom){
var_dump($dom);
}
array(5) {
["_id"]=>
object(MongoId)#8 (1) {
["$id"]=>
string(24) "5ac0d90bbb8b88b2438b4567"
}
["title"]=>
string(12) "测试标题"
["description"]=>
string(7) "mongodb"
["likes"]=>
int(100)
["url"]=>
string(9) "imlee.top"
}
成都创新互联公司公司2013年成立,先为淳安等服务建站,淳安等地企业,进行企业商务咨询服务。为淳安企业网站制作PC+手机+微官网三网同步一站式服务解决您的所有建站问题。