Right now there are a couple ways to set the "usePowerOf2" user flag on a collection.
1) Create the collection. Then later call
db.runCommand( { "collMod" : coll , "usePowerOf2Sizes" : true } );
2) At creation time, run
db.runCommand( {"create" : coll, "flags" : 1 } );
The latter is not very intuitive, since it relies on the user knowing how to interpret the "flags" bitmask.
We should allow a syntax like this:
db.runCommand( {"create" : coll, "usePowerOf2Sizes" : true } );
and more generally, any option you can pass to "collMod" should also be something you can pass to "create".
- related to
-
SERVER-5046 per collection option to pad to power of 2
- Closed