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().

+ Repo –
+ Atom editor –
+ Download GIT –
+ MongoDB –
+ Robomongo –

JS Playlist –

NODEJS Playlist –

ASYNC JS Playlist –

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


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

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

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

For more front-end development tutorials & to black-belt your coding skills, head over to – or

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

Twitter – @TheNetNinja –


  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


Please enter your comment!
Please enter your name here