SHARE

Hey gang, in this MongoDB tutorial for beginners tutorial I want to show you how to search for and find records using Mongoose. We do this via a number of methods, but the ones we’ll be looking at in this series are find() and findOne().

—– COURSE LINKS:
+ Repo – https://github.com/iamshaunjp/mongodb-playlist
+ Atom editor – https://atom.io/a
+ Download GIT – https://git-scm.com/
+ CMDER – http://cmder.net/
+ MongoDB – https://www.mongodb.com/
+ Robomongo – https://robomongo.org/

JS Playlist – https://www.youtube.com/playlist?list=PL4cUxeGkcC9i9Ae2D9Ee1RvylH38dKuET

NODEJS Playlist – https://www.youtube.com/playlist?list=PL4cUxeGkcC9gcy9lrvMJ75z9maRw4byYp

ASYNC JS Playlist – https://www.youtube.com/playlist?list=PL4cUxeGkcC9jAhrjtZ9U93UMIhnCc44MH

———————————————————————————————
You can find more front-end development tutorials on CSS, HTML, JavaScript, jQuery, WordPress, Node.js & more on the channel homepage…

SUBSCRIBE TO CHANNEL – https://www.youtube.com/channel/UCW5YeuERMmlnqo4oq8vwUpg?sub_confirmation=1

========== PSD to WordPress Playlist ==========

https://www.youtube.com/playlist?list=PL4cUxeGkcC9gnow7e45LQFkNVxwQ5BH-W

============ Node.js for Beginners Playlist =============

https://www.youtube.com/playlist?list=PL4cUxeGkcC9gcy9lrvMJ75z9maRw4byYp

============== The Net Ninja =====================

For more front-end development tutorials & to black-belt your coding skills, head over to – https://www.youtube.com/channel/UCW5YeuERMmlnqo4oq8vwUpg or http://thenetninja.co.uk

================== Social Links ==================

Twitter – @TheNetNinja – https://twitter.com/thenetninjauk

7 COMMENTS

  1. The idea of ​​the tests is that you do not risk the system. That is, you create a database for the tests different than the original and there you do your tests. In these cases it is useless but in important projects you must protect the integrity of the data.

  2. Hi Shaun,

    Great Tutorials!! I loved your sessions on Angular too!. I have a question with this tutorial though. I see that the assert statement is provided inside the 'then' function of the findOne().

    If the search fails and no records are returned, the test will still show up as pass correct as the assert is not even executed?

  3. hey ninjas) I have a problem with code inside beforeEach dropping the collection before findOne searches for needed record, cuz I've been trying to console.log found record and I get null without commenting out beforeEach, but without beforeEach code there is that problem with copies of records in my collection…. Ay ideas?

  4. Really not understanding why we have this testing mocha stuff, seems very contrived. But then again I'm not an experienced developer…

  5. Hey Shaun how are you??Nice serie.Will you do a project with Mongodb?And is there a way to secure Robomongo(add a password to GUI)?Thank you

LEAVE A REPLY

Please enter your comment!
Please enter your name here