Home > Backend Development > PHP Tutorial > MongoDB插入数据后返回信息代码释义

MongoDB插入数据后返回信息代码释义

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-06 20:45:08
Original
1053 people have browsed it

PHP程序,附代码:

$mongo = new MongoClient();
$db = $mongo->btss;
$hashs = $mongo->db->hash;
$hash = $hashs->insert(array('hash' => $msg));
var_dump($hash);
Copy after login
Copy after login

执行后返回:

array(4) { ["ok"]=> float(1) ["n"]=> int(0) ["err"]=> NULL ["errmsg"]=> NULL }
Copy after login
Copy after login

我在mongo中检查没有数据,但是这个错误又没有有用的信息,特此来请教下(GG也没有)

回复内容:

PHP程序,附代码:

$mongo = new MongoClient();
$db = $mongo->btss;
$hashs = $mongo->db->hash;
$hash = $hashs->insert(array('hash' => $msg));
var_dump($hash);
Copy after login
Copy after login

执行后返回:

array(4) { ["ok"]=> float(1) ["n"]=> int(0) ["err"]=> NULL ["errmsg"]=> NULL }
Copy after login
Copy after login

我在mongo中检查没有数据,但是这个错误又没有有用的信息,特此来请教下(GG也没有)

因为你把数据添加到了db这个数据库里,而不是btss

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
mongodb start
From 1970-01-01 08:00:00
0
0
0
linux - ubuntu14 error installing mongodb
From 1970-01-01 08:00:00
0
0
0
Use of symfony2 mongodb
From 1970-01-01 08:00:00
0
0
0
mongodb _id rename
From 1970-01-01 08:00:00
0
0
0
Parameter understanding of mongodb
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template