HELP Combining mongodb collections for a random name generator

I’m working on a MERN CRUD build as a personal exercise to learn both react and mongodb. I wanted to build a simple fullname generator for rpg characters.

I have 3 mongodb collections which look like this (they all contain 50 names per race, including both genders):

                    "firstname_race": "<race>"
                    "firstname_name": "<name>"
                    "firstname_gender": "<gender>"

                    "start_lastnames_race": "<race>"
                    "start_lastnames_name": "<name>"

                    "end_lastnames_race": "<race>"
                    "end_lastnames_name": "<name>"

And I have 3 models: firstname.model, start_lastname.model and end_lastname.model.
I want to show the user an output list of 10 full names like this (not correct language):

`fullname = {} + '' + {start_lastname.start_lastname_name} + {end_lastname.end_lastname_name}`
`gender = {firstname.gender}`
`race = {firstname.race}` which is === `{start_lastname.start_lastname_race}` and === `{end_lastname.end_lastname_race}`

and the user can filter by gender and race via a /get form.

So how can this be accomplished? Should I first create a fullname.model which populates from the other models and then facet aggregations? Does anybody know where I can find a working example of a MERN CRUD where the user can press checkboxes to choose facets? Or does anybody know of a simple npm tool for this sort of thing? I’ve read mongoose, axios and mongodb documention for days and I can’t understand where I’m supposed to start.

I should add that I want to keep the collections seperated to be able to add new partial names into the db later. I want the lastnames to be combined because it makes the randomness greater :stuck_out_tongue:

I have created a working simple TODO app but it only had one collection and I’m used to working with sql-joins.

Please comment if my information is insufficient for an answer.