Last active
August 3, 2019 20:12
-
-
Save ShawonAshraf/2a1355ea5831d74a151e0949135a601e to your computer and use it in GitHub Desktop.
Code for mongodb-nodejs-medium article
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // filter | |
| const filter = { | |
| name: 'Red Dead Redemption 2', | |
| platform: 'XBOXONE' | |
| }; | |
| await deleteDoc(db, filter); | |
| const deleteDoc = async(db, filter) => { | |
| try { | |
| await db.collection('games').findOneAndDelete(filter); | |
| console.log('Document deleted...'); | |
| } catch (e) { | |
| console.log(e.toString()); | |
| } | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment