Documentation ¶
Index ¶
- func AggregateCount(coll *mongo.Collection, ctx context.Context, pipeline bson.A, ...) (int64, error)
- func AggregateGetIndexById(coll *mongo.Collection, ctx context.Context, pipeline bson.A, id interface{}) (int64, error)
- func FindById(coll *mongo.Collection, ctx context.Context, id interface{}) (*mongo.SingleResult, error)
- func FindOne(coll *mongo.Collection, ctx context.Context, args *map[string]interface{}, ...) (*mongo.SingleResult, error)
- func GetCount(coll *mongo.Collection, ctx context.Context) (int64, error)
- func GetIndexById(coll *mongo.Collection, ctx context.Context, id interface{}) (int64, error)
- func Sync(coll *mongo.Collection, ctx context.Context, mixed interface{}) error
- type AggregateSliceMetadata
- type FindSliceMetadata
- type SliceMetadata
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AggregateCount ¶
func AggregateCount( coll *mongo.Collection, ctx context.Context, pipeline bson.A, restOpts ...*options.CountOptions) (int64, error)
AggregateCount takes a pipeline and count the results
func AggregateGetIndexById ¶
func AggregateGetIndexById(coll *mongo.Collection, ctx context.Context, pipeline bson.A, id interface{}) (int64, error)
GetIndexById Obtain the index from collection using id as referece
func FindById ¶
func FindById(coll *mongo.Collection, ctx context.Context, id interface{}) (*mongo.SingleResult, error)
func FindOne ¶
func FindOne(coll *mongo.Collection, ctx context.Context, args *map[string]interface{}, opts ...*options.FindOneOptions) (*mongo.SingleResult, error)
func GetIndexById ¶
GetIndexById Obtain the index from collection using id as referece
Types ¶
type AggregateSliceMetadata ¶
type AggregateSliceMetadata struct { Total int64 `json:"total"` SliceCount int64 `json:"sliceCount"` SliceStart int64 `json:"sliceStart"` }
FindSliceMetadata
func (*AggregateSliceMetadata) GetSliceCount ¶
func (meta *AggregateSliceMetadata) GetSliceCount() int64
func (*AggregateSliceMetadata) GetSliceStart ¶
func (meta *AggregateSliceMetadata) GetSliceStart() int64
func (*AggregateSliceMetadata) GetTotal ¶
func (meta *AggregateSliceMetadata) GetTotal() int64
type FindSliceMetadata ¶
type FindSliceMetadata struct { Total int `json:"total"` SliceCount int `json:"sliceCount"` SliceStart int `json:"sliceStart"` }
FindSliceMetadata
type SliceMetadata ¶
func AggregateSlice ¶
func AggregateSlice( coll *mongo.Collection, ctx context.Context, pipeline bson.A, ) ( result []bson.Raw, meta SliceMetadata, err error, )
Click to show internal directories.
Click to hide internal directories.