I have a collection which represents a list of available sport matches (see image below, sorry for the italian text). Each document is a match, and has a list of players which are subscribed to that match (id_player1, id_player2, etc).
When someone would like to subscribe to that match, I have to cycle through the players_id, and when I find a null one, I set it to the user's id.
So my questions are:
- how can I cycle through the fields of the document and check if they are null or not?
- how can I count how many fields are not null, so when this count is equal to X, I do something?
