fixed Count method

This commit is contained in:
nefrace 2023-01-24 23:17:43 +03:00
parent ca8aa11a00
commit e58da1b7d0
1 changed files with 3 additions and 2 deletions

View File

@ -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)
}