Working with MongoIds and auto-incrementing ids in MongoDB
In this blog post I will explain how to work with both MongoIds and auto-incrementing ids in MongoDb in your PHP application. MongoDB assigns a special MongoID hash to each inserted document.