Lecture: The Document Model in MongoDB - Can multiple versions of data model co-exist?


I have a question regarding flexibility - in the lecture there is an example to show how the document model can flexibily change over time. THe example shows “Phone”: 888888 and then over time it changes to array of numbers. So change the data type is possible and also this leads to multiple versions of the schema. Is it the case that the both the versions of the schema co-exist. i.e., if i have data pipeline that supports version 1 and another newer data pipeline that supports version 2 both can be still valid? I dont need to update my version 1 data pipeline to confirm to version 2 data model?


Yes, thats right. It means giving you the flexibility to control your data and application versions. Your application or your dataset is not blocked if you decide to have multiple phone numbers or different versions of schema.

So, you can start working on version 2 and as suited, you can either go for bulk moving the version 1 documents or handle it on the application level, totally depending on how you want to handle the old schema.

I hope this helps, if I misunderstood your query please feel free to provide more details on the query.