It's not quite clear from the documentation: when and how often should I run rake db:mongoid:create_indexes
. Let's say I added some indexes macro to the models already and am never going to add new ones in the future. Does that mean I may run the rake task just once or should I be running it, say, once a day?
You should run the task once.
After the indexes have been created, you don't need to run the command anymore as the indexes already exist and don't need to be added again.
Of course, if you create new indexes, you'll need to run the command to add the new indexes to mongodb.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With