Closed Puddinglord closed 4 years ago
@Puddinglord Hey, how are you creating the indexes in your database?
I assume you're populating your database schema and collections while testing your application. Is the index creation part of this population?
I was unaware that I could create a unique index on a collection using the JS driver. I have always made them using Compass. Thanks for putting me on the right track and I appreciate you making this action as it's saved me a ton of time 👏
I can confirm that I can add a unique index via the nodejs driver and have done so successfully. My unit tests now run correctly with a fresh container spun up each time.
Thank you for setting me on the right path. I will close this issue now.
@Puddinglord Great! Good to hear your tests are passing now 😃 Sweet!
Also nice we both learned something new: I didn't know you can create indexes in Compass. I'm typically using Robo 3T as a MongoDB GUI. Compass keeps getting better in terms of features 👍
When running my unit tests my production database has a unique index field
date: 1
. When running my unit tests using this action the tests fail because there is no unique index on the date field.Would it be possible to add unique index support?