mongoschema

Undocumented in source.

Modules

aliases
module mongoschema.aliases
Undocumented in source.
date
module mongoschema.date

This module provides Date serialization with an extra added magic value to serialize the current date at serialization time.

db
module mongoschema.db

This module provides the database utility tools which make the whole project useful.

query
module mongoschema.query

This module provides a typesafe querying framework. For now only very basic queries are supported

variant
module mongoschema.variant

This module provides a utility class to store different type values inside a single field. This can for example be used to model inheritance.

Public Imports

vibe.data.bson
public import vibe.data.bson;
Undocumented in source.
vibe.db.mongo.collection
public import vibe.db.mongo.collection;
Undocumented in source.
vibe.db.mongo.connection
public import vibe.db.mongo.connection;
Undocumented in source.
mongoschema.date
public import mongoschema.date;
Undocumented in source.
mongoschema.db
public import mongoschema.db;
Undocumented in source.
mongoschema.query
public import mongoschema.query;
Undocumented in source.
mongoschema.variant
public import mongoschema.variant;
Undocumented in source.

Members

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

bsonToMember
T bsonToMember(T member, Bson value)

Converts any bson value to a given type

fromSchemaBson
T fromSchemaBson(Bson bson)

Generates a struct/class object from a Bson node

memberToBson
Bson memberToBson(T member)

Converts any value to a bson value

toSchemaBson
Bson toSchemaBson(T obj)

Generates a Bson document from a struct/class object

Structs

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.

Templates

isVariable
template isVariable(alias T)
Undocumented in source.
isVariable
template isVariable(T)
Undocumented in source.

Meta