Documentation ¶
Index ¶
- func GetClient() *mongo.Client
- type AbstractRepository
- func (r *AbstractRepository) Find(filters bson.M, sort bson.D, limit, skip int64) chan Result
- func (r *AbstractRepository) FindOne(filters bson.M) chan Result
- func (r *AbstractRepository) FindOneById(id string) chan Result
- func (r *AbstractRepository) GetModel(proto interface{}) interface{}
- func (r *AbstractRepository) IsExistsById(id string) bool
- func (r *AbstractRepository) Save(model DbModel) chan error
- type DbModel
- type Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AbstractRepository ¶
func (*AbstractRepository) FindOne ¶
func (r *AbstractRepository) FindOne(filters bson.M) chan Result
Finds one object based on filters.
func (*AbstractRepository) FindOneById ¶
func (r *AbstractRepository) FindOneById(id string) chan Result
Finds one object based on Id.
func (*AbstractRepository) GetModel ¶
func (r *AbstractRepository) GetModel(proto interface{}) interface{}
Gets an instance of model from proto or othe object.
func (*AbstractRepository) IsExistsById ¶ added in v0.1.7
func (r *AbstractRepository) IsExistsById(id string) bool
checks if a record exists by id. Synchronous becuase it is expected to be very light-weighted without deserialization etc.
func (*AbstractRepository) Save ¶
func (r *AbstractRepository) Save(model DbModel) chan error
Click to show internal directories.
Click to hide internal directories.