插入操作 查看返回值

// $result = $mongoObj->insert($data); //insert插入成功返回结果array(6) { ["connectionId"]=> int(36862) ["n"]=> int(0) ["syncMillis"]=> int(0) ["writtenTo"]=> NULL ["err"]=> NULL ["ok"]=> float(1) }

1:更新成功后,返回array(7) { ["connectionId"]=> int(36864) ["updatedExisting"]=> bool(true) ["n"]=> int(1) ["syncMillis"]=> int(0) ["writtenTo"]=> NULL ["err"]=> NULL ["ok"]=> float(1) }

//2:失败后array(7) { ["connectionId"]=> int(36864) ["updatedExisting"]=> bool(false) ["n"]=> int(0) ["syncMillis"]=> int(0) ["writtenTo"]=> NULL ["err"]=> NULL ["ok"]=> float(1) }

//1:删除成功操作后,返回的结果 array(6) { ["connectionId"]=> int(36865) ["n"]=> int(1) ["syncMillis"]=> int(0) ["writtenTo"]=> NULL ["err"]=> NULL ["ok"]=> float(1) }

//2:删除失败后,返回的结果 array(6) { ["connectionId"]=> int(36865) ["n"]=> int(0) ["syncMillis"]=> int(0) ["writtenTo"]=> NULL ["err"]=> NULL ["ok"]=> float(1) }

//返回取出的值

//array(4) { ["_id"]=> object(MongoId)#7 (1) { ["$id"]=> string(24) "58a3ed5a6e0ef78c27000030" } ["name"]=> string(9) "zhangxiao" ["age"]=> string(2) "19" ["sex"]=> string(3) "nan" }