I've found that in order to create an index in a collection I should use the indexesManager:
collection.indexesManager.ensure(...)
I would like to know which is the right place for this function call.
I put this call in the function of the Controller that performs the insertion of documents in the collection, and it works. But I guess that it is not necessary to call this function on each insertion.
Is there a way to make this call only once when the DB is initialized?
Thanks