So, I'm putting together a MongoDB database to store XML documents. There are plenty of reasons for why I would want to do something seemingly insane like this; most importantly, I need to be able to see what's changed in the document as well as easily access individual element and attribute values.
I want to store each individual "item" as a row. By "item," I mean each child of the root element. Each item will have standard XML attributes and element children.
Now, one thing to keep in mind: Some of these documents are going to be small (< 100kb), others pretty big (> 100mb). Obviously, plenty in between as well. The documents are going range from a few hundred items to potentially hundreds of thousands.
My initial thought was to have an Item model for each item, with its child elements and attributes as nested documents. Consider this XML doc:
<root>