Creating a document:
$db->collection->insert($content);
// $newDocID = ???
How to get the new document's id?
According to the docs the array you pass to insert
will be amended with an _id
field:
$db->collection->insert($content);
$newDocID = $content['_id'];