RejectedSoftware Forums

Sign up

Does Vibe.d support shard_key of MongoDB collection?

One of the most important feature of MongoDB is Sharding, which makes MongoDB works as cluster and provides larger throughput.

However, I couldn't find any API of vibe.d's MongoDB driver that set shard keys.
http://vibed.org/api/vibe.db.mongo.collection/MongoCollection.ensureIndex

Does any one knows where to specify shard keys?

For reference, Python's MongoEngine provide sharding key specifying API via meta member field of documentation class.

https://mongoengine-odm.readthedocs.org/guide/defining-documents.html#shard-keys

Thanks.

Re: Does Vibe.d support shard_key of MongoDB collection?

On Thu, 13 Aug 2015 14:02:48 GMT, Alvin Chung wrote:

One of the most important feature of MongoDB is Sharding, which makes MongoDB works as cluster and provides larger throughput.

However, I couldn't find any API of vibe.d's MongoDB driver that set shard keys.
http://vibed.org/api/vibe.db.mongo.collection/MongoCollection.ensureIndex

Does any one knows where to specify shard keys?

For reference, Python's MongoEngine provide sharding key specifying API via meta member field of documentation class.

https://mongoengine-odm.readthedocs.org/guide/defining-documents.html#shard-keys

Thanks.

It's currently not supported, because I never got as far with MongoDB to use sharding. AFAIR it requires additional support on the client side to distribute queries among the shards, so this is unfortunately more than a quick addition to ensureIndex.

In any case, you should open an issue on the bug tracker, so that this doesn't get lost.