@@ -3996,14 +3996,14 @@ Model.hydrate = function hydrate(obj, projection, options) {
39963996 * @api public
39973997 */
39983998
3999- Model . updateMany = function updateMany ( conditions , update , options ) {
3999+ Model . updateMany = function updateMany ( filter , update , options ) {
40004000 _checkContext ( this , 'updateMany' ) ;
40014001
40024002 if ( update == null ) {
40034003 throw new MongooseError ( 'updateMany `update` parameter cannot be nullish' ) ;
40044004 }
40054005
4006- return _update ( this , 'updateMany' , conditions , update , options ) ;
4006+ return _update ( this , 'updateMany' , filter , update , options ) ;
40074007} ;
40084008
40094009/**
@@ -4044,10 +4044,10 @@ Model.updateMany = function updateMany(conditions, update, options) {
40444044 * @api public
40454045 */
40464046
4047- Model . updateOne = function updateOne ( conditions , doc , options ) {
4047+ Model . updateOne = function updateOne ( filter , update , options ) {
40484048 _checkContext ( this , 'updateOne' ) ;
40494049
4050- return _update ( this , 'updateOne' , conditions , doc , options ) ;
4050+ return _update ( this , 'updateOne' , filter , update , options ) ;
40514051} ;
40524052
40534053/**
@@ -4067,7 +4067,7 @@ Model.updateOne = function updateOne(conditions, doc, options) {
40674067 * - `replaceOne()`
40684068 *
40694069 * @param {object } filter
4070- * @param {object } doc
4070+ * @param {object } replacement
40714071 * @param {object } [options] optional see [`Query.prototype.setOptions()`](https://mongoosejs.com/docs/api/query.html#Query.prototype.setOptions())
40724072 * @param {boolean|'throw' } [options.strict] overwrites the schema's [strict mode option](https://mongoosejs.com/docs/guide.html#strict)
40734073 * @param {boolean } [options.upsert=false] if true, and no documents found, insert a new document
@@ -4081,15 +4081,15 @@ Model.updateOne = function updateOne(conditions, doc, options) {
40814081 * @api public
40824082 */
40834083
4084- Model . replaceOne = function replaceOne ( conditions , doc , options ) {
4084+ Model . replaceOne = function replaceOne ( filter , replacement , options ) {
40854085 _checkContext ( this , 'replaceOne' ) ;
40864086
40874087 const versionKey = this ?. schema ?. options ?. versionKey || null ;
4088- if ( versionKey && ! doc [ versionKey ] ) {
4089- doc [ versionKey ] = 0 ;
4088+ if ( versionKey && ! replacement [ versionKey ] ) {
4089+ replacement [ versionKey ] = 0 ;
40904090 }
40914091
4092- return _update ( this , 'replaceOne' , conditions , doc , options ) ;
4092+ return _update ( this , 'replaceOne' , filter , replacement , options ) ;
40934093} ;
40944094
40954095/**
0 commit comments