mongoschema

Undocumented in source.

Modules

aliases
module mongoschema.aliases
Undocumented in source.

Members

Classes

DocumentNotFoundException
class DocumentNotFoundException

Exception thrown if a document could not be found.

Enums

mongoBackground
enum mongoBackground

Background index construction allows read and write operations to continue while building the index.

mongoDropDuplicates
enum mongoDropDuplicates

Drops duplicates in the database. Only for Mongo versions less than 3.0

mongoForceIndex
enum mongoForceIndex

Will create an index with (by default) no flags.

mongoSparse
enum mongoSparse

Sparse indexes are like non-sparse indexes, except that they omit references to documents that do not include the indexed field.

mongoUnique
enum mongoUnique

MongoDB allows you to specify a unique constraint on an index. These constraints prevent applications from inserting documents that have duplicate values for the inserted fields.

schemaIgnore
enum schemaIgnore

Will ignore the variables and not encode/decode them.

Functions

fromSchemaBson
T fromSchemaBson(Bson bson)

Generates a struct/class object from a Bson node

register
void register(MongoCollection collection)

Binds a MongoCollection to a Schema. Can only be done once!

toSchemaBson
Bson toSchemaBson(T obj)

Generates a Bson document from a struct/class object

Mixin templates

MongoSchema
mixintemplate MongoSchema()

Mixin for functions for interacting with Mongo collections.

Structs

DocumentRange
struct DocumentRange(Schema)

Range for iterating over a collection using a Schema.

PipelineUnwindOperation
struct PipelineUnwindOperation
SchemaDate
struct SchemaDate

Class serializing to a bson date containing a special now value that gets translated to the current time when converting to bson.

SchemaPipeline
struct SchemaPipeline
binaryType
struct binaryType

Encodes the value as binary value. Must be an array with one byte wide elements.

decode
struct decode

Custom decode function. func is the name of the function which must be present as child.

encode
struct encode

Custom encode function. func is the name of the function which must be present as child.

mongoExpire
struct mongoExpire

TTL indexes expire documents after the specified number of seconds has passed since the indexed field value; i.e. the expiration threshold is the indexed field value plus the specified number of seconds. Field must be a SchemaDate/BsonDate. You must update the time using collMod.

schemaName
struct schemaName

Custom name for special characters.

Meta