Documentation ¶
Overview ¶
Package bsondoc builds on an existing bson doc according to the provided entity model schema.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Build ¶
func Build( ctx context.Context, bsonDoc *bson.D, entityModelSchema *schema.EntityModelSchema, translateTo TranslateToEnum, ) error
Build builds on the given bson doc based on the provided schema.EntityModelSchema.
func GetFieldValueFromRootDoc ¶
GetFieldValueFromRootDoc returns the value of the provided field (nil if not found) from the root of a bson doc.
Types ¶
type TranslateToEnum ¶
type TranslateToEnum string
TranslateToEnum is the enum for the type of translation to be done.
const ( TranslateToEnumMongo TranslateToEnum = "mongo" // translate to mongo doc TranslateToEnumEntityModel TranslateToEnum = "entity_model" // translate to entity model )
Click to show internal directories.
Click to hide internal directories.