@@ -12,7 +12,7 @@ import type { PkFactory } from './mongo_client';
12
12
import type {
13
13
Filter ,
14
14
Flatten ,
15
- OptionalId ,
15
+ OptionalUnlessRequiredId ,
16
16
TODO_NODE_3286 ,
17
17
UpdateFilter ,
18
18
WithId ,
@@ -264,16 +264,22 @@ export class Collection<TSchema extends Document = Document> {
264
264
* @param options - Optional settings for the command
265
265
* @param callback - An optional callback, a Promise will be returned if none is provided
266
266
*/
267
- insertOne ( doc : OptionalId < TSchema > ) : Promise < InsertOneResult < TSchema > > ;
268
- insertOne ( doc : OptionalId < TSchema > , callback : Callback < InsertOneResult < TSchema > > ) : void ;
269
- insertOne ( doc : OptionalId < TSchema > , options : InsertOneOptions ) : Promise < InsertOneResult < TSchema > > ;
267
+ insertOne ( doc : OptionalUnlessRequiredId < TSchema > ) : Promise < InsertOneResult < TSchema > > ;
270
268
insertOne (
271
- doc : OptionalId < TSchema > ,
269
+ doc : OptionalUnlessRequiredId < TSchema > ,
270
+ callback : Callback < InsertOneResult < TSchema > >
271
+ ) : void ;
272
+ insertOne (
273
+ doc : OptionalUnlessRequiredId < TSchema > ,
274
+ options : InsertOneOptions
275
+ ) : Promise < InsertOneResult < TSchema > > ;
276
+ insertOne (
277
+ doc : OptionalUnlessRequiredId < TSchema > ,
272
278
options : InsertOneOptions ,
273
279
callback : Callback < InsertOneResult < TSchema > >
274
280
) : void ;
275
281
insertOne (
276
- doc : OptionalId < TSchema > ,
282
+ doc : OptionalUnlessRequiredId < TSchema > ,
277
283
options ?: InsertOneOptions | Callback < InsertOneResult < TSchema > > ,
278
284
callback ?: Callback < InsertOneResult < TSchema > >
279
285
) : Promise < InsertOneResult < TSchema > > | void {
@@ -308,19 +314,22 @@ export class Collection<TSchema extends Document = Document> {
308
314
* @param options - Optional settings for the command
309
315
* @param callback - An optional callback, a Promise will be returned if none is provided
310
316
*/
311
- insertMany ( docs : OptionalId < TSchema > [ ] ) : Promise < InsertManyResult < TSchema > > ;
312
- insertMany ( docs : OptionalId < TSchema > [ ] , callback : Callback < InsertManyResult < TSchema > > ) : void ;
317
+ insertMany ( docs : OptionalUnlessRequiredId < TSchema > [ ] ) : Promise < InsertManyResult < TSchema > > ;
318
+ insertMany (
319
+ docs : OptionalUnlessRequiredId < TSchema > [ ] ,
320
+ callback : Callback < InsertManyResult < TSchema > >
321
+ ) : void ;
313
322
insertMany (
314
- docs : OptionalId < TSchema > [ ] ,
323
+ docs : OptionalUnlessRequiredId < TSchema > [ ] ,
315
324
options : BulkWriteOptions
316
325
) : Promise < InsertManyResult < TSchema > > ;
317
326
insertMany (
318
- docs : OptionalId < TSchema > [ ] ,
327
+ docs : OptionalUnlessRequiredId < TSchema > [ ] ,
319
328
options : BulkWriteOptions ,
320
329
callback : Callback < InsertManyResult < TSchema > >
321
330
) : void ;
322
331
insertMany (
323
- docs : OptionalId < TSchema > [ ] ,
332
+ docs : OptionalUnlessRequiredId < TSchema > [ ] ,
324
333
options ?: BulkWriteOptions | Callback < InsertManyResult < TSchema > > ,
325
334
callback ?: Callback < InsertManyResult < TSchema > >
326
335
) : Promise < InsertManyResult < TSchema > > | void {
@@ -1526,7 +1535,7 @@ export class Collection<TSchema extends Document = Document> {
1526
1535
* @param callback - An optional callback, a Promise will be returned if none is provided
1527
1536
*/
1528
1537
insert (
1529
- docs : OptionalId < TSchema > [ ] ,
1538
+ docs : OptionalUnlessRequiredId < TSchema > [ ] ,
1530
1539
options : BulkWriteOptions ,
1531
1540
callback : Callback < InsertManyResult < TSchema > >
1532
1541
) : Promise < InsertManyResult < TSchema > > | void {
0 commit comments