Created
August 3, 2019 20:18
-
-
Save ShawonAshraf/8f60ddd8a3f5d20fcc1645180dc845b1 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
| const readAllDocs = async(db) => { | |
| try { | |
| const docs = await db.collection('games').find({}); | |
| return docs.toArray(); | |
| } catch (e) { | |
| console.log(e.toString()); | |
| } | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment