I’m adding a parent to a student, so it would mean I need to have the chatroom id also in the student collection somehow, right? Then I should be able to add the parent to the chatroom with the same chatroom id? The problem might be that the same parents can have multiple chatrooms with different teachers for the same student.
If you put student in another collection other than users collection, that means this student does not have access to login.
If the teacher is responsible for inputting student data, there could be multiple students created for each teacher.
It is better to sort this database design first before continuing.
For invite parents, there should be a unique code sent, so that they can be assigned to the correct student.
For multiple chatrooms with different teacher for the same student, that would need additional linked field to teacher collection (which I assume you put into users collection), this can be used during filter to get the right chatroom.