(no title)
diverightin63 | 10 years ago
Say in MongoDB you are storing documents in a collection such as { property: "" }, and decide you want to change that to { property2: "" }. Does that mean you have to script a change to every document to convert these objects?
hereandthere2|10 years ago
`Collection.rename('property', 'property2')`
my syntax may be slightly off since i mostly use mongo thru a ruby orm but the basic idea is the same.
we handle these things by having a tasks we run each deployment (named after the deployment version) with the necessary db changes.
coldtea|10 years ago
And yes, you have to script a change to every document.
diverightin63|10 years ago
djmashko2|10 years ago
X-Istence|10 years ago
In MongoDB you have to manually walk all your objects and migrate them.
diverightin63|10 years ago