Move Mongo Embeded Document into Own Collection

Can someone point me in the right direction, i have a Collection (Forms) each Form has an embedded document array (Responses). Responses for each form have gotten massive and in hindsight embedding them was a bad idea (mongo documents including embedded have a maximum size limit).

Is there a way i can quickly and easily move all of these embedded Responses into their own collection? is there such a thing like the old SQL select into? I have had a look around in rails console but it is inaccessible with so many embedded documents, so i imagine it'll have to be a complex find and insert query in the mongo console? (just guessing there)

My Model is fixed but this migration (and the mongo docs) are stumping me.

TIA Дугл

5
задан Niels van der Rest 30 March 2011 в 07:49
поделиться