I have a MongoDB server running on an 64-bit Amazon EC2 instance (journaling enabled). Yesterday I updated some documents and refreshed the webpage to make sure it reflects the changes. It did. But today I see that not only yesterday's changes are gone. I lost a week of updates! Why could this be and is it possible to recover the lost data?
Maybe there's something wrong in the way I make the changes?
public function edit_app()
{
$query = array('_id' => $_POST['id']);
$apps = $this->mongo->db->apps;
if ($app = $apps->findOne($query)) {
$app['title'] = $_POST['title'];
$app['version'] = $_POST['version'];
$app['author'] = $_POST['author'];
...
$apps->save($app);
}
}