fixed Count method
This commit is contained in:
parent
ca8aa11a00
commit
e58da1b7d0
5
store.go
5
store.go
|
@ -130,6 +130,7 @@ func (s Store[T]) ReplaceItem(ctx context.Context, item T, upsert bool) error {
|
|||
return err
|
||||
}
|
||||
|
||||
func (s Store[T]) Count(ctx context.Context, filter *bson.D) (int64, error) {
|
||||
return s.Coll.CountDocuments(ctx, filter)
|
||||
func (s Store[T]) Count(ctx context.Context, filter ...bson.E) (int64, error) {
|
||||
f := getFilter(filter)
|
||||
return s.Coll.CountDocuments(ctx, f)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue