@@ -12,7 +12,7 @@ import type { PkFactory } from './mongo_client';
1212import type {
1313 Filter ,
1414 Flatten ,
15- OptionalId ,
15+ OptionalUnlessRequiredId ,
1616 TODO_NODE_3286 ,
1717 UpdateFilter ,
1818 WithId ,
@@ -264,16 +264,22 @@ export class Collection<TSchema extends Document = Document> {
264264 * @param options - Optional settings for the command
265265 * @param callback - An optional callback, a Promise will be returned if none is provided
266266 */
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 > > ;
270268 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 > ,
272278 options : InsertOneOptions ,
273279 callback : Callback < InsertOneResult < TSchema > >
274280 ) : void ;
275281 insertOne (
276- doc : OptionalId < TSchema > ,
282+ doc : OptionalUnlessRequiredId < TSchema > ,
277283 options ?: InsertOneOptions | Callback < InsertOneResult < TSchema > > ,
278284 callback ?: Callback < InsertOneResult < TSchema > >
279285 ) : Promise < InsertOneResult < TSchema > > | void {
@@ -308,19 +314,22 @@ export class Collection<TSchema extends Document = Document> {
308314 * @param options - Optional settings for the command
309315 * @param callback - An optional callback, a Promise will be returned if none is provided
310316 */
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 ;
313322 insertMany (
314- docs : OptionalId < TSchema > [ ] ,
323+ docs : OptionalUnlessRequiredId < TSchema > [ ] ,
315324 options : BulkWriteOptions
316325 ) : Promise < InsertManyResult < TSchema > > ;
317326 insertMany (
318- docs : OptionalId < TSchema > [ ] ,
327+ docs : OptionalUnlessRequiredId < TSchema > [ ] ,
319328 options : BulkWriteOptions ,
320329 callback : Callback < InsertManyResult < TSchema > >
321330 ) : void ;
322331 insertMany (
323- docs : OptionalId < TSchema > [ ] ,
332+ docs : OptionalUnlessRequiredId < TSchema > [ ] ,
324333 options ?: BulkWriteOptions | Callback < InsertManyResult < TSchema > > ,
325334 callback ?: Callback < InsertManyResult < TSchema > >
326335 ) : Promise < InsertManyResult < TSchema > > | void {
@@ -1526,7 +1535,7 @@ export class Collection<TSchema extends Document = Document> {
15261535 * @param callback - An optional callback, a Promise will be returned if none is provided
15271536 */
15281537 insert (
1529- docs : OptionalId < TSchema > [ ] ,
1538+ docs : OptionalUnlessRequiredId < TSchema > [ ] ,
15301539 options : BulkWriteOptions ,
15311540 callback : Callback < InsertManyResult < TSchema > >
15321541 ) : Promise < InsertManyResult < TSchema > > | void {
0 commit comments