Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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