Documentation ¶
Index ¶
Constants ¶
View Source
const ( IDFieldName = "_id" UpdatedAtFieldName = "updatedat" )
Common field names.
Variables ¶
View Source
var NewObjID = primitive.NewObjectID
NewObjID generates a new object id.
View Source
var UpdatedAt = func() int64 { return time.Now().UnixNano() }
UpdatedAt returns a value suitable for UpdatedAt field.
Functions ¶
func NewObjIDWithValue ¶
NewObjIDWithValue sets id for next objectID generation.
func ZeroOrDoesNotExist ¶
ZeroOrDoesNotExist generates a filter expression with field equal to zero or field does not exist.
Types ¶
type UpdatedAtField ¶
type UpdatedAtField struct {
UpdatedAt int64 `bson:"updatedat"`
}
UpdatedAtField defines the updatedat field.
Click to show internal directories.
Click to hide internal directories.