I am attempting to programmatically "enable sharding" and set the "shard key" using java/scala API particularly casbah
Our config
scala 2.10
casbah 2.6 - "org.mongodb" % "casbah_2.10" % "2.6.0",
MongoDB 2.4.4
Also what is the casbah driver version for mongo 2.4.4 (with scala 2.10)
Our use case is such that, collections + indexes are created programmatically using the casbah scala API dbConnection.getCollection(....)
and collection.ensureIndex(DBObject("orgId" -> 1), DBObject("background" -> true, "name" -> "org_idx", "unique" -> false))
Is there an equivalent casbah API to programmatically, enableSharding and choose shardKey as well as we are currently sharding our mongo cluster to scale out. Our database + collection names are not known ahead time and a dynamically created using API, so a enabling sharding using mongo shell is simply not an option.
Is there a better way to do this ? ANy recommendations?