Documentation ¶
Index ¶
Constants ¶
View Source
const ( MongoTag = "mongo" TagName = "name" OmitKey = "mongo:omit" )
Constants used in the mongo tags
View Source
const ( // TagIndex is used on the struct tags for mongo field definition. TagIndex = "index" UniqueIndex = "unique" UUIDIndex = "uuid" DescendingIndex = "desc" AscendingIndex = "asc" // default )
constants used as the index tags.
Variables ¶
View Source
var StoreIndexes = storeIndexStruct{}
StoreIndexes is the key used for the model's struct definition that stores the index value.
Functions ¶
func ExtractModel ¶
func ExtractModel(m *mapping.ModelStruct) (err error)
ExtractModel migrates the neuron mapped ModelStruct into mongo specification.
Types ¶
type FieldIndex ¶
type FieldIndex struct { Field *mapping.StructField Order query.SortOrder }
FieldIndex is the struct used for getting the pair - field:order for the index.
func (FieldIndex) BSON ¶
func (f FieldIndex) BSON() bson.E
BSON gets the bson.E value for the given Field Index.
type Index ¶
type Index struct { Fields []FieldIndex Name string Unique bool }
Index is the mongo field's index structure.
Click to show internal directories.
Click to hide internal directories.