File tree 2 files changed +7
-3
lines changed
2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -1366,7 +1366,7 @@ export class Collection<TSchema extends Document = Document> {
1366
1366
* @param pipeline - An array of aggregation pipelines to execute
1367
1367
* @param options - Optional settings for the command
1368
1368
*/
1369
- aggregate < T = TSchema > (
1369
+ aggregate < T = Document > (
1370
1370
pipeline : Document [ ] = [ ] ,
1371
1371
options ?: AggregateOptions
1372
1372
) : AggregationCursor < T > {
Original file line number Diff line number Diff line change 1
- import { expectType } from 'tsd' ;
2
- import { AggregationCursor , MongoClient } from '../../../../src/index' ;
1
+ import { expectNotType , expectType } from 'tsd' ;
2
+ import { AggregationCursor , MongoClient , Document } from '../../../../src/index' ;
3
3
4
4
// collection.aggregate tests
5
5
const client = new MongoClient ( '' ) ;
@@ -11,6 +11,10 @@ interface Payment {
11
11
}
12
12
const cursor : AggregationCursor < Payment > = collection . aggregate < Payment > ( [ { } ] ) ;
13
13
14
+ const payments = db . collection < Payment > ( 'banking' ) ;
15
+ expectType < AggregationCursor < Document > > ( payments . aggregate ( ) ) ;
16
+ expectNotType < AggregationCursor < Payment > > ( payments . aggregate ( ) ) ;
17
+
14
18
cursor . match ( { bar : 1 } ) . limit ( 10 ) ;
15
19
16
20
collection . aggregate ( [ { $match : { bar : 1 } } , { $limit : 10 } ] ) ;
You can’t perform that action at this time.
0 commit comments