Hello!
I need to "ensure" an index but because the table has 30 million objects in it, I want the indexing operation (if needed) to run in the background.
According to the Java driver you can call ensureIndex with two parameters, a list of of indexes, and a list of options:
http://api.mongodb.org/java/current/com/mongodb/DBCollection.html#ensureIndex(com.mongodb.DBObject,%20com.mongodb.DBObject)
I'm not seeing this with the Casbah version. Am I missing something? Or is this a missing feature that should be added?
Here's what I want to be able to do:
val indexes = MongoDBObject("foo" -> 1, "location" -> "2d")
val options = MongoDBObject("background" -> true)
collection.ensureIndex(indexes, options)
I suppose I can use createIndex, which in my particular circumstance might be okay, or collection.underlying, but, still...
Keith