create own files_id in mongo GridFs using PHP
问题 for a better distribution of files in a sharded Mongo GridFs I'd like to create my own files_id. How this can be done in Java is described here: http://groups.google.com/group/mongodb-user/msg/524bae1602770587 But how to do this in PHP? I could find no hint in the API documentation, I use storeBytes for saving the files: http://www.php.net/manual/en/mongogridfs.storebytes.php 回答1: You should be able to just set this in the "$extra" argument with the "_id" key, something like: $m = new Mongo;