Documentation ¶
Index ¶
- func Aggregate(results interface{}, pipeline interface{}, opts ...*options.AggregateOptions) error
- func AggregateFirst(model ModelInterface, pipeline interface{}, opts ...*options.AggregateOptions) (bool, error)
- func AggregateFirstWithCtx(ctx context.Context, result ModelInterface, pipeline interface{}, ...) (bool, error)
- func AggregateWithCtx(ctx context.Context, results interface{}, pipeline interface{}, ...) error
- func Close()
- func Coll(model ModelInterface) *mongo.Collection
- func Ctx() context.Context
- func Delete(model ModelInterface, opts ...*options.DeleteOptions) error
- func DeleteMany(model ModelInterface, query interface{}, opts ...*options.DeleteOptions) (*mongo.DeleteResult, error)
- func DeleteManyWithCtx(ctx context.Context, model ModelInterface, query interface{}, ...) (*mongo.DeleteResult, error)
- func DeleteOne(model ModelInterface, query interface{}, opts ...*options.DeleteOptions) (*mongo.DeleteResult, error)
- func DeleteOneWithCtx(ctx context.Context, model ModelInterface, query interface{}, ...) (*mongo.DeleteResult, error)
- func DeleteWithCtx(ctx context.Context, model ModelInterface, opts ...*options.DeleteOptions) error
- func FindByObjectID(model ModelInterface, id interface{}, opts ...*options.FindOneOptions) error
- func FindByObjectIDWithCtx(ctx context.Context, model ModelInterface, id interface{}, ...) error
- func FindByObjectIDs(results interface{}, ids interface{}, additionalPipeline ...interface{}) error
- func FindMany(results interface{}, query interface{}, opts ...*options.FindOptions) error
- func FindManyWithCtx(ctx context.Context, results interface{}, query interface{}, ...) error
- func FindOne(model ModelInterface, query interface{}, opts ...*options.FindOneOptions) error
- func FindOneWithCtx(ctx context.Context, model ModelInterface, query interface{}, ...) error
- func GetClient() (*mongo.Client, error)
- func GetCollection(collectionName string) (*mongo.Collection, error)
- func GetDatabase() (*mongo.Database, error)
- func IgnoredFunction1() string
- func IgnoredFunction2() string
- func Initialise(cfg Config, opts ...*options.ClientOptions) error
- func InsertOne(model ModelInterface, opts ...*options.InsertOneOptions) error
- func InsertOneWithCtx(ctx context.Context, model ModelInterface, opts ...*options.InsertOneOptions) error
- func Transaction(fn codegen.TransactionFunc) error
- func TransactionWithOptions(fn codegen.TransactionFunc, opts *options.SessionOptions) error
- func Update(model ModelInterface, opts ...*options.UpdateOptions) error
- func UpdateMany(model ModelInterface, filter interface{}, update interface{}, ...) (*mongo.UpdateResult, error)
- func UpdateManyWithCtx(ctx context.Context, model ModelInterface, filter interface{}, ...) (*mongo.UpdateResult, error)
- func UpdateOne(model ModelInterface, filter interface{}, update interface{}, ...) (*mongo.UpdateResult, error)
- func UpdateOneWithCtx(ctx context.Context, model ModelInterface, filter interface{}, ...) (*mongo.UpdateResult, error)
- func UpdateWithCtx(ctx context.Context, model ModelInterface, opts ...*options.UpdateOptions) error
- type AnotherModel
- func (m *AnotherModel) AggregateFirst(pipeline interface{}, opts ...*options.AggregateOptions) (bool, error)
- func (*AnotherModel) CollectionName() string
- func (m *AnotherModel) Create(opts ...*options.InsertOneOptions) error
- func (m *AnotherModel) CreateWithCtx(ctx context.Context, opts ...*options.InsertOneOptions) error
- func (m *AnotherModel) Created() error
- func (m *AnotherModel) Creating() error
- func (m *AnotherModel) Delete(opts ...*options.DeleteOptions) error
- func (m *AnotherModel) DeleteWithCtx(ctx context.Context, opts ...*options.DeleteOptions) error
- func (m *AnotherModel) Deleted() error
- func (m *AnotherModel) Deleting() error
- func (m *AnotherModel) Find(query interface{}, opts ...*options.FindOneOptions) error
- func (m *AnotherModel) FindByObjectID(id interface{}, opts ...*options.FindOneOptions) error
- func (m *AnotherModel) FindByObjectIDWithCtx(ctx context.Context, id interface{}, opts ...*options.FindOneOptions) error
- func (m *AnotherModel) FindWithCtx(ctx context.Context, query interface{}, opts ...*options.FindOneOptions) error
- func (m *AnotherModel) Queried() error
- func (m *AnotherModel) Saved() error
- func (m *AnotherModel) Saving() error
- func (m *AnotherModel) Update(opts ...*options.UpdateOptions) error
- func (m *AnotherModel) UpdateWithCtx(ctx context.Context, opts ...*options.UpdateOptions) error
- func (m *AnotherModel) Updated() error
- func (m *AnotherModel) Updating() error
- type Config
- type Model
- func (m *Model) AggregateFirst(pipeline interface{}, opts ...*options.AggregateOptions) (bool, error)
- func (*Model) CollectionName() string
- func (m *Model) Create(opts ...*options.InsertOneOptions) error
- func (m *Model) CreateWithCtx(ctx context.Context, opts ...*options.InsertOneOptions) error
- func (m *Model) Created() error
- func (m *Model) Creating() error
- func (m *Model) Delete(opts ...*options.DeleteOptions) error
- func (m *Model) DeleteWithCtx(ctx context.Context, opts ...*options.DeleteOptions) error
- func (m *Model) Deleted() error
- func (m *Model) Deleting() error
- func (m *Model) Find(query interface{}, opts ...*options.FindOneOptions) error
- func (m *Model) FindByObjectID(id interface{}, opts ...*options.FindOneOptions) error
- func (m *Model) FindByObjectIDWithCtx(ctx context.Context, id interface{}, opts ...*options.FindOneOptions) error
- func (m *Model) FindWithCtx(ctx context.Context, query interface{}, opts ...*options.FindOneOptions) error
- func (m *Model) GetResolved_Reference() (AnotherModel, error)
- func (m *Model) GetResolved_ReferenceMap() (map[string]AnotherModel, error)
- func (m *Model) GetResolved_ReferenceMapPtr() (map[string]*AnotherModel, error)
- func (m *Model) GetResolved_ReferencePtr() (*AnotherModel, error)
- func (m *Model) GetResolved_ReferencePtrMap() (*map[string]AnotherModel, error)
- func (m *Model) GetResolved_ReferencePtrSlice() (*[]AnotherModel, error)
- func (m *Model) GetResolved_ReferenceSlice() ([]AnotherModel, error)
- func (m *Model) GetResolved_ReferenceSliceInSlice() ([][]*AnotherModel, error)
- func (m *Model) Queried() error
- func (m *Model) Saved() error
- func (m *Model) Saving() error
- func (m *Model) Update(opts ...*options.UpdateOptions) error
- func (m *Model) UpdateWithCtx(ctx context.Context, opts ...*options.UpdateOptions) error
- func (m *Model) Updated() error
- func (m *Model) Updating() error
- type ModelInterface
- type ModelQueryMethods
- type StructAddedInOutput
- type SubModel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Aggregate ¶
func Aggregate(results interface{}, pipeline interface{}, opts ...*options.AggregateOptions) error
func AggregateFirst ¶
func AggregateFirst(model ModelInterface, pipeline interface{}, opts ...*options.AggregateOptions) (bool, error)
func AggregateFirstWithCtx ¶
func AggregateFirstWithCtx(ctx context.Context, result ModelInterface, pipeline interface{}, aggregateOpts ...*options.AggregateOptions) (bool, error)
func AggregateWithCtx ¶
func AggregateWithCtx(ctx context.Context, results interface{}, pipeline interface{}, aggregateOpts ...*options.AggregateOptions) error
func Coll ¶
func Coll(model ModelInterface) *mongo.Collection
func Delete ¶
func Delete(model ModelInterface, opts ...*options.DeleteOptions) error
func DeleteMany ¶
func DeleteMany(model ModelInterface, query interface{}, opts ...*options.DeleteOptions) (*mongo.DeleteResult, error)
func DeleteManyWithCtx ¶
func DeleteManyWithCtx(ctx context.Context, model ModelInterface, query interface{}, opts ...*options.DeleteOptions) (*mongo.DeleteResult, error)
func DeleteOne ¶
func DeleteOne(model ModelInterface, query interface{}, opts ...*options.DeleteOptions) (*mongo.DeleteResult, error)
func DeleteOneWithCtx ¶
func DeleteOneWithCtx(ctx context.Context, model ModelInterface, query interface{}, opts ...*options.DeleteOptions) (*mongo.DeleteResult, error)
func DeleteWithCtx ¶
func DeleteWithCtx(ctx context.Context, model ModelInterface, opts ...*options.DeleteOptions) error
func FindByObjectID ¶
func FindByObjectID(model ModelInterface, id interface{}, opts ...*options.FindOneOptions) error
func FindByObjectIDWithCtx ¶
func FindByObjectIDWithCtx(ctx context.Context, model ModelInterface, id interface{}, opts ...*options.FindOneOptions) error
func FindByObjectIDs ¶
func FindByObjectIDs(results interface{}, ids interface{}, additionalPipeline ...interface{}) error
func FindMany ¶
func FindMany(results interface{}, query interface{}, opts ...*options.FindOptions) error
func FindManyWithCtx ¶
func FindManyWithCtx(ctx context.Context, results interface{}, query interface{}, opts ...*options.FindOptions) error
func FindOne ¶
func FindOne(model ModelInterface, query interface{}, opts ...*options.FindOneOptions) error
func FindOneWithCtx ¶
func FindOneWithCtx(ctx context.Context, model ModelInterface, query interface{}, opts ...*options.FindOneOptions) error
func GetCollection ¶
func GetCollection(collectionName string) (*mongo.Collection, error)
func GetDatabase ¶
func IgnoredFunction1 ¶
func IgnoredFunction1() string
func IgnoredFunction2 ¶
func IgnoredFunction2() string
func Initialise ¶
func Initialise(cfg Config, opts ...*options.ClientOptions) error
func InsertOne ¶
func InsertOne(model ModelInterface, opts ...*options.InsertOneOptions) error
func InsertOneWithCtx ¶
func InsertOneWithCtx(ctx context.Context, model ModelInterface, opts ...*options.InsertOneOptions) error
func Transaction ¶
func Transaction(fn codegen.TransactionFunc) error
func TransactionWithOptions ¶
func TransactionWithOptions(fn codegen.TransactionFunc, opts *options.SessionOptions) error
func Update ¶
func Update(model ModelInterface, opts ...*options.UpdateOptions) error
func UpdateMany ¶
func UpdateMany(model ModelInterface, filter interface{}, update interface{}, opts ...*options.UpdateOptions) (*mongo.UpdateResult, error)
func UpdateManyWithCtx ¶
func UpdateManyWithCtx(ctx context.Context, model ModelInterface, filter interface{}, update interface{}, opts ...*options.UpdateOptions) (*mongo.UpdateResult, error)
func UpdateOne ¶
func UpdateOne(model ModelInterface, filter interface{}, update interface{}, opts ...*options.UpdateOptions) (*mongo.UpdateResult, error)
func UpdateOneWithCtx ¶
func UpdateOneWithCtx(ctx context.Context, model ModelInterface, filter interface{}, update interface{}, opts ...*options.UpdateOptions) (*mongo.UpdateResult, error)
func UpdateWithCtx ¶
func UpdateWithCtx(ctx context.Context, model ModelInterface, opts ...*options.UpdateOptions) error
Types ¶
type AnotherModel ¶
func (*AnotherModel) AggregateFirst ¶
func (m *AnotherModel) AggregateFirst(pipeline interface{}, opts ...*options.AggregateOptions) (bool, error)
func (*AnotherModel) CollectionName ¶
func (*AnotherModel) CollectionName() string
func (*AnotherModel) Create ¶
func (m *AnotherModel) Create(opts ...*options.InsertOneOptions) error
func (*AnotherModel) CreateWithCtx ¶
func (m *AnotherModel) CreateWithCtx(ctx context.Context, opts ...*options.InsertOneOptions) error
func (*AnotherModel) Created ¶
func (m *AnotherModel) Created() error
func (*AnotherModel) Creating ¶
func (m *AnotherModel) Creating() error
func (*AnotherModel) Delete ¶
func (m *AnotherModel) Delete(opts ...*options.DeleteOptions) error
func (*AnotherModel) DeleteWithCtx ¶
func (m *AnotherModel) DeleteWithCtx(ctx context.Context, opts ...*options.DeleteOptions) error
func (*AnotherModel) Deleted ¶
func (m *AnotherModel) Deleted() error
func (*AnotherModel) Deleting ¶
func (m *AnotherModel) Deleting() error
func (*AnotherModel) Find ¶
func (m *AnotherModel) Find(query interface{}, opts ...*options.FindOneOptions) error
func (*AnotherModel) FindByObjectID ¶
func (m *AnotherModel) FindByObjectID(id interface{}, opts ...*options.FindOneOptions) error
func (*AnotherModel) FindByObjectIDWithCtx ¶
func (m *AnotherModel) FindByObjectIDWithCtx(ctx context.Context, id interface{}, opts ...*options.FindOneOptions) error
func (*AnotherModel) FindWithCtx ¶
func (m *AnotherModel) FindWithCtx(ctx context.Context, query interface{}, opts ...*options.FindOneOptions) error
func (*AnotherModel) Queried ¶
func (m *AnotherModel) Queried() error
func (*AnotherModel) Saved ¶
func (m *AnotherModel) Saved() error
func (*AnotherModel) Saving ¶
func (m *AnotherModel) Saving() error
func (*AnotherModel) Update ¶
func (m *AnotherModel) Update(opts ...*options.UpdateOptions) error
func (*AnotherModel) UpdateWithCtx ¶
func (m *AnotherModel) UpdateWithCtx(ctx context.Context, opts ...*options.UpdateOptions) error
func (*AnotherModel) Updated ¶
func (m *AnotherModel) Updated() error
func (*AnotherModel) Updating ¶
func (m *AnotherModel) Updating() error
type Config ¶
type Config struct { OperationTimeout time.Duration DatabaseName string TxnSessionOptions *options.SessionOptions }
type Model ¶
type Model struct { codegen.BaseModel Sub SubModel Reference primitive.ObjectID ReferencePtr *primitive.ObjectID ReferenceSlice []primitive.ObjectID ReferenceSliceInSlice [][]*primitive.ObjectID ReferenceMap map[string]primitive.ObjectID ReferenceMapPtr map[string]*primitive.ObjectID ReferencePtrSlice *[]primitive.ObjectID ReferencePtrMap *map[string]primitive.ObjectID // contains filtered or unexported fields }
func (*Model) AggregateFirst ¶
func (m *Model) AggregateFirst(pipeline interface{}, opts ...*options.AggregateOptions) (bool, error)
func (*Model) CollectionName ¶
func (*Model) CreateWithCtx ¶
func (*Model) DeleteWithCtx ¶
func (*Model) FindByObjectID ¶
func (m *Model) FindByObjectID(id interface{}, opts ...*options.FindOneOptions) error
func (*Model) FindByObjectIDWithCtx ¶
func (*Model) FindWithCtx ¶
func (*Model) GetResolved_Reference ¶
func (m *Model) GetResolved_Reference() (AnotherModel, error)
func (*Model) GetResolved_ReferenceMap ¶
func (m *Model) GetResolved_ReferenceMap() (map[string]AnotherModel, error)
func (*Model) GetResolved_ReferenceMapPtr ¶
func (m *Model) GetResolved_ReferenceMapPtr() (map[string]*AnotherModel, error)
func (*Model) GetResolved_ReferencePtr ¶
func (m *Model) GetResolved_ReferencePtr() (*AnotherModel, error)
func (*Model) GetResolved_ReferencePtrMap ¶
func (m *Model) GetResolved_ReferencePtrMap() (*map[string]AnotherModel, error)
func (*Model) GetResolved_ReferencePtrSlice ¶
func (m *Model) GetResolved_ReferencePtrSlice() (*[]AnotherModel, error)
func (*Model) GetResolved_ReferenceSlice ¶
func (m *Model) GetResolved_ReferenceSlice() ([]AnotherModel, error)
func (*Model) GetResolved_ReferenceSliceInSlice ¶
func (m *Model) GetResolved_ReferenceSliceInSlice() ([][]*AnotherModel, error)
func (*Model) UpdateWithCtx ¶
type ModelInterface ¶
type ModelQueryMethods ¶
type ModelQueryMethods interface { AggregateFirst(pipeline interface{}, opts ...*options.AggregateOptions) (bool, error) Find(interface{}, ...*options.FindOneOptions) error FindWithCtx(context.Context, interface{}, ...*options.FindOneOptions) error FindByObjectID(interface{}, ...*options.FindOneOptions) error FindByObjectIDWithCtx(context.Context, interface{}, ...*options.FindOneOptions) error Create(...*options.InsertOneOptions) error CreateWithCtx(context.Context, ...*options.InsertOneOptions) error Update(...*options.UpdateOptions) error UpdateWithCtx(context.Context, ...*options.UpdateOptions) error Delete(...*options.DeleteOptions) error DeleteWithCtx(context.Context, ...*options.DeleteOptions) error } // Available query methods
type StructAddedInOutput ¶
type StructAddedInOutput struct { }
Click to show internal directories.
Click to hide internal directories.