File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
packages/effect-mongodb/dtslint Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -174,3 +174,19 @@ Collection.dropIndex(collection, "birthday_1")
174
174
175
175
// $ExpectType Effect<void, MongoError, never>
176
176
F . pipe ( collection , Collection . dropIndex ( "birthday_1" ) )
177
+
178
+ // -------------------------------------------------------------------------------------
179
+ // aggregate
180
+ // -------------------------------------------------------------------------------------
181
+
182
+ const MyAggregatedType = Schema . Struct ( {
183
+ _id : Schema . Date ,
184
+ birthdays : Schema . Number
185
+ } )
186
+ const groupByBirthday = [ { $group : { _id : "$birthday" , birthdays : { $sum : 1 } } } ]
187
+
188
+ // $ExpectType AggregationCursor<{ readonly _id: Date; readonly birthdays: number; }, { readonly _id: string; readonly birthdays: number; }, never>
189
+ Collection . aggregate ( collection , groupByBirthday , MyAggregatedType )
190
+
191
+ // $ExpectType AggregationCursor<{ readonly _id: Date; readonly birthdays: number; }, { readonly _id: string; readonly birthdays: number; }, never>
192
+ F . pipe ( collection , Collection . aggregate ( groupByBirthday , MyAggregatedType ) )
You can’t perform that action at this time.
0 commit comments