私はコレクションを更新することにちょっと悩まされています。
だから、私はこのクエリを持っています:
$coll->update(
array("_id" => new MongoId($_POST["id"])),
array("$set" => array(
"contentType" => htmlspecialchars(strip_tags(trim($_POST["type"]))),
"contentTitle" => htmlspecialchars(strip_tags(trim($_POST["title"]))),
"contentBody" => htmlspecialchars(strip_tags(trim($_POST["content"])))
)),
true,
false
);
Please don't bother with the way of validating the $_POST, it's only a test, but it doesn't work. The collection is ok, I have checked that. It doesn't do anything, and when I insert
var_dump($db->lastError());
it gives me no errors at all.