Skip to content

Commit 6d0fbd8

Browse files
committed
Collection: add type-level tests for estimatedDocumentCount and countDocuments
1 parent 8527caa commit 6d0fbd8

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

packages/effect-mongodb/dtslint/Collection.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,3 +190,23 @@ Collection.aggregate(collection, groupByBirthday, MyAggregatedType)
190190

191191
// $ExpectType AggregationCursor<{ readonly _id: Date; readonly birthdays: number; }, { readonly _id: string; readonly birthdays: number; }, never>
192192
F.pipe(collection, Collection.aggregate(groupByBirthday, MyAggregatedType))
193+
194+
// -------------------------------------------------------------------------------------
195+
// estimatedDocumentCount
196+
// -------------------------------------------------------------------------------------
197+
198+
// $ExpectType Effect<number, MongoError, never>
199+
Collection.estimatedDocumentCount(collection)
200+
201+
// $ExpectType Effect<number, MongoError, never>
202+
F.pipe(collection, Collection.estimatedDocumentCount())
203+
204+
// -------------------------------------------------------------------------------------
205+
// countDocuments
206+
// -------------------------------------------------------------------------------------
207+
208+
// $ExpectType Effect<number, MongoError, never>
209+
Collection.countDocuments(collection, { birthday: "2024-11-28" })
210+
211+
// $ExpectType Effect<number, MongoError, never>
212+
F.pipe(collection, Collection.countDocuments({ birthday: "2024-11-28" }))

0 commit comments

Comments
 (0)