$mongo = new MongoClient();
$db = $mongo->database;
// access collection
$collection = $db->collection;
$collection->insert($_POST['data']);
$m = new MongoClient();
$collection = $m->selectCollection('test', 'phpmanual');
// If an array literal is used, there is no way to access the generated _id
$collection->insert(array('x' => 1));