Document serialization uses field order to ensure a strict order is set (#296)

This commit is contained in:
Ross Lawley
2013-04-26 11:38:45 +00:00
parent 2447349383
commit 36993097b4
8 changed files with 94 additions and 23 deletions

View File

@@ -24,6 +24,9 @@ objects** as class attributes to the document class::
title = StringField(max_length=200, required=True)
date_modified = DateTimeField(default=datetime.datetime.now)
As BSON (the binary format for storing data in mongodb) is order dependent,
documents are serialized based on their field order.
Dynamic document schemas
========================
One of the benefits of MongoDb is dynamic schemas for a collection, whilst data
@@ -51,6 +54,7 @@ be saved ::
There is one caveat on Dynamic Documents: fields cannot start with `_`
Dynamic fields are stored in alphabetical order *after* any declared fields.
Fields
======