SSPkrolik / nimongo

Pure Nim lang MongoDB driver
http://sspkrolik.github.io/nimongo
MIT License
101 stars 20 forks source link

[Question] Indexing Support? #36

Open FFX01 opened 6 years ago

FFX01 commented 6 years ago

Hi!

I'm fairly new to MongoDb and Nim. I have extensive experience working with Python and JavaScript. I'm experimenting with Nim's web application capabilities and will be using your library to build a micro-framework (well, try to at least).

However, one of the most important features of MongoDb is it's indexing capabilities. Unfortunately, it doesn't seem like Nimongo supports creating indexes natively. Of course one could always use the mongo shell to create indexes, but I am a huge fan of declarative programming and think it would be nice to be able to work with Mongo indexes natively in Nim. A good example of what I mean is how indexing is handled in pymongo and MongoEngine.

MongoEngine, of course, relies heavily on Python's dynamic nature and tries to act more like Django's ORM than anything else. However, I believe it is a good example of how an indexing API can be implemented.

So, what I'm wondering is where I should start if I wanted to contribute indexing functionality to Nimongo.

SSPkrolik commented 6 years ago

Hi, @FFX01, I'll try to find some time next week to implement basic indexing queries. Anyway contribution is welcomed, Mongo's query protocol is not that hard :)

timotheecour commented 5 years ago

ping on this, without indexes mongo can be much slower this is how vibe.d (in D) does the API: http://vibed.org/api/vibe.db.mongo.collection/MongoCollection.ensureIndex

links