@@ -0,0 +1,614 @@
+import mongoengine%0A%0A%0Aclass BrokerStruct(object):%0A    %22%22%22%0A    Copy the data out of a mongoengine.Document, including nested Documents,%0A    but do not copy any of the mongo-specific methods or attributes.%0A    %22%22%22%0A    def __init__(self, mongo_document):%0A        %22%22%22%0A        Parameters%0A        ----------%0A        mongo_document : mongoengine.Document%0A        %22%22%22%0A        fields = mongo_document._fields%0A        for field in fields:%0A            attr = getattr(mongo_document, field)%0A            if isinstance(attr, mongoengine.Document):%0A                attr = BrokerStruct(attr)%0A            setattr(self, field, attr)%0A

Add a structure for copying the data (only the data) from a Document.