I have a one to many relationship between "region" and "story" collections. I.e. each region has multiple stories. The story collection contains every story for every region with a "regionId" key that identifies what region that story belongs to. I am going to need to lookup stories associated with various regionIds, presumably using Story.find{"regionId" : <regionId>}
In the future there could be thousands or millions of total stories and am aware doing a collection search would be very inefficient. Initially I made a "stories" field in "regions" so I could lookup by _id but I realized that would create a reference nightmare. My question is, can I just index the "regionId" field to accomplish what I want, even though there are multiple documents with the same regionId?
storySchema.createIndex{ { regionId: 1 } }