db-migrate / mongodb

mongodb driver for db-migrate
Other
25 stars 58 forks source link

Fir for Add sparse options for index #11

Open ramakrishnan opened 8 years ago

ramakrishnan commented 8 years ago

Fix for #10 Added provision to pass sparse option while creating index

ramakrishnan commented 8 years ago

@wzrdtales I feel passing the index options as an object will make the code more flexible. I will add a work around for backward compatibility. Moving forward shall we encourage users to pass as options?

Please share your thoughts.

wzrdtales commented 8 years ago

@ramakrishnan I would rather go for an options object than adding the huge bunch of arguments that you want to add. And it would be the better solution if we talk about flexibility though.

Though from my side I would remove your params again and give the optionality to pass an object in instead and handle the backwards compatibility by just checking if the second param is a string or an object.

wzrdtales commented 8 years ago

@ramakrishnan Confused your changes with the original, but it keeps the same. Just passing in the second param as an object should be enough to check for the original behavior.

ramakrishnan commented 8 years ago

Exactly in line with my thoughts. Backward compatibility I mean is to check if the second param is a string or an object.

wzrdtales commented 8 years ago

Apart from the last mentioned items everything looks fine though :)