You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Inserts a single document or a an array of documents into MongoDB. If documents passed in do not contain the **_id** field,
1639
-
* one will be added to each of the documents missing it by the driver, mutating the document. This behavior
1640
-
* can be overridden by setting the **forceServerObjectId** flag.
1641
-
*
1642
-
* @deprecated Use insertOne, insertMany or bulkWrite instead. Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance
1643
-
* @param docs - The documents to insert
1644
-
* @param options - Optional settings for the command
1645
-
* @param callback - An optional callback, a Promise will be returned if none is provided
1646
-
*/
1647
-
insert(
1648
-
docs: OptionalUnlessRequiredId<TSchema>[],
1649
-
options: BulkWriteOptions,
1650
-
callback: Callback<InsertManyResult<TSchema>>
1651
-
): Promise<InsertManyResult<TSchema>>|void{
1652
-
emitWarningOnce(
1653
-
'collection.insert is deprecated. Use insertOne, insertMany or bulkWrite instead.'
* @deprecated use updateOne, updateMany or bulkWrite. Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance
1670
-
* @param filter - The filter for the update operation.
1671
-
* @param update - The update operations to be applied to the documents
1672
-
* @param options - Optional settings for the command
1673
-
* @param callback - An optional callback, a Promise will be returned if none is provided
1674
-
*/
1675
-
update(
1676
-
filter: Filter<TSchema>,
1677
-
update: UpdateFilter<TSchema>,
1678
-
options: UpdateOptions,
1679
-
callback: Callback<Document>
1680
-
): Promise<UpdateResult>|void{
1681
-
emitWarningOnce(
1682
-
'collection.update is deprecated. Use updateOne, updateMany, or bulkWrite instead.'
* @deprecated use deleteOne, deleteMany or bulkWrite. Callbacks are deprecated and will be removed in the next major version. See [mongodb-legacy](https://github.com/mongodb-js/nodejs-mongodb-legacy) for migration assistance
1694
-
* @param filter - The filter for the remove operation.
1695
-
* @param options - Optional settings for the command
1696
-
* @param callback - An optional callback, a Promise will be returned if none is provided
1697
-
*/
1698
-
remove(
1699
-
filter: Filter<TSchema>,
1700
-
options: DeleteOptions,
1701
-
callback: Callback
1702
-
): Promise<DeleteResult>|void{
1703
-
emitWarningOnce(
1704
-
'collection.remove is deprecated. Use deleteOne, deleteMany, or bulkWrite instead.'
0 commit comments