The simplest pairing system we can implement is to simply lookup if there is another user available without a pair whenever someone signs up.
In order to do so, we'll start a new collection and model: Meeting, which will be the base matching structure we'll be expanding on. The fundamental idea here is that each document will represent a meeting; either it's in the request phase, already set or occurred, finally will also store the feedback.
We'll be elaborating and defining the structure for it as it goes. For an initial implementation, let's run the scheduling logic right when the user decides to be matched. The strategy will be to look for a meeting document, where only the first user is set, and update it. In case there is no document like that, let's create a new one.
There are a couple of race conditions that might kick in, which we certainly want to avoid. These are as follows:
The user who's trying to find someone to schedule gets scheduled in the middle of the process...