Skip to content

FIX - Deprecated remove() func Breaks app - causes MongoDB error#215

Open
TracyChacon wants to merge 1 commit intobradtraversy:masterfrom
TracyChacon:patch-2
Open

FIX - Deprecated remove() func Breaks app - causes MongoDB error#215
TracyChacon wants to merge 1 commit intobradtraversy:masterfrom
TracyChacon:patch-2

Conversation

@TracyChacon
Copy link

DETAILS

  • Chapter: 11 Admin Screens -Part 1
  • Video: Deleting the Admin User
  • TimeStamp: 01:25
  • Location : userController.js / productController.js

ISSUE

the remove() function is now deprecated and documentation/ mongodb forum advise the use of deleteOne() or deleteMany()

PROPOSED CHANGE

The proposed code change makes it so that the app doesn't break.

Change any invocations ( in userController.js/productController.js in the backend) of :

remove()

To :

deleteOne()

…move() with deleteOne()

#### DETAILS
- Chapter: 11 Admin Screens -Part 1
- Video: Deleting the Admin User
- TimeStamp:  01:25
 - Location : ```userController.js ``` / ```productController.js

#### ISSUE
the ```remove()``` function is now deprecated and documentation/forums advise the use of ```deleteOne()``` or ```deleteMany()```    [https://www.mongodb.com/community/forums/t/error-message-remove-is-not-a-function-name-typeerror/207387]

#### PROPOSED CHANGE
 The proposed code change makes it so that the app doesn't break. 

**Change any  invocations ( in ```userController.js```/```productController.js in the backend) of  ```remove()``` to ```deleteOne()``` **
@TracyChacon TracyChacon changed the title Deprecated remove() func Breaks app - Fix, See for details FIX - Deprecated remove() func Breaks app - See for details Apr 1, 2023
@TracyChacon TracyChacon mentioned this pull request Apr 22, 2023
@TracyChacon TracyChacon changed the title FIX - Deprecated remove() func Breaks app - See for details FIX - Deprecated remove() func Breaks app - causes MongoDB error Apr 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant