Is there a way to create a sparse index using the MongoDb (2.2) C++ driver?
It seems that the ensureIndex
function does not accept this argument. From MongoDb docs:
bool mongo::DBClientWithCommands::ensureIndex(
const string & ns,
BSONObj keys,
bool unique = false,
const string & name = "",
bool cache = true,
bool background = false,
int v = -1)
I ended up patching the Mongo source code (
mongo/cleint/dbclient.cpp
):The issue should be resolved in version 2.3.2