class Thread(Queryable): __collection__ = 'threads' class Flags(Document): locked = Boolean() sticky = Boolean() hidden = Boolean() uploads = Boolean() class Comment(Identified, Reply): class Votes(Document): count = Integer() who = Array(ObjectId()) id = ObjectId('_id') message = String() vote = Embed(Votes) creator = ObjectId() updated = Date(default=utcnow, assign=True) uploads = Array(ObjectId()) # GridFS file references. class Continuation(Reply): continued = Reference() title = String() forum = Reference() replies = Array(Embed(Reply)) flag = Embed(Flags) stat = Embed(Statistics) subscribers = Array(ObjectId()) updated = Date(default=utcnow, assign=True)
class Sample(Document): class Embedded(Document): name = String() generic = Field() field = String('field_name') number = Number('field_name', default=27) array = Array(Number(default=42), name='field_name') embed = Embed(Embedded)
class Account(Queryable): __collection__ = 'collection' username = String(required=True) name = String() locale = String(default='en-CA-u-tz-cator-cu-CAD', assign=True) age = Number() tag = Array(String(), assign=True) _username = Index('username', unique=True)
class Comment(Identified, Reply): class Votes(Document): count = Integer() who = Array(ObjectId()) id = ObjectId('_id') message = String() vote = Embed(Votes) creator = ObjectId() updated = Date(default=utcnow, assign=True) uploads = Array(ObjectId()) # GridFS file references.
class Sample(Document): field = Field() number = Number() array = Array()
class Votes(Document): count = Integer() who = Array(ObjectId())
class Person(Queryable): __collection__ = 'people' name = String() tag = Array(String())
class Sample(Document): field = String() number = Number('other') array = Array(String())
class Sample(Document): field = Array(String()) alias = Alias('field.0')
class Sample(Document): class Embedded(Document): field = String() field = Array(Embedded) alias = Alias('field.0.field')
class Arrays(Document): foo = Array(String()) bar = Array(String())