How do you handle schema changes in Mongo db e.g. say after refactoring you change your object schema design and that impacts the document schema. Is there a way to update the document schema?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can run an update on the entire schema, removing fields, or adding fields and setting them to calculated values, if that’s what you’re getting at.
Say you had an x field, and you want to add a y field that should be set to x/2, you could do something like this: