I have 2 collections: Hospital and Patient. This month the patient is examination at hospital A, But next month, this patient is examination at hospital B. So when updating
Mongodb does not allow specific joins like a sql based db. I would recommend creating a your hospital collection schema as needed (most likely just basic types such as strings and numbers) and then store a list of visits or examinations with the date and location as part of your patient schema (see: https://mongoosejs.com/docs/schematypes.html#arrays). While you cannot enforce at a database level that the examination location is a valid hospital, you could certainly enforce this in your code.