* Inserts a single document into MongoDB. If documents passed in do not contain the **_id** field, * one will be added to each of the documents missing it by the driver, mutating the document. This behavior * can be overridden by setting the **forceServerObjectId** flag. * * @param doc -
(
doc: OptionalUnlessRequiredId<TSchema>,
options?: InsertOneOptions
)
| 288 | * @param options - Optional settings for the command |
| 289 | */ |
| 290 | async insertOne( |
| 291 | doc: OptionalUnlessRequiredId<TSchema>, |
| 292 | options?: InsertOneOptions |
| 293 | ): Promise<InsertOneResult<TSchema>> { |
| 294 | return await executeOperation( |
| 295 | this.client, |
| 296 | new InsertOneOperation( |
| 297 | this as TODO_NODE_3286, |
| 298 | doc, |
| 299 | resolveOptions(this, options) |
| 300 | ) as TODO_NODE_3286 |
| 301 | ); |
| 302 | } |
| 303 | |
| 304 | /** |
| 305 | * Inserts an array of documents into MongoDB. If documents passed in do not contain the **_id** field, |