Create a CRUD App with Node and MongoDB: Lesson 12 of 17

Showing Real Events

Up Next

Creating Events

Autoplaying in 7 seconds!



Table of Contents

    e'll use mongoose and the mongoose model we created to grab real events from our MongoDB database.

    To grab events:

    // grab all events, the {} matches all
    Event.find({}, (err, events) => {
    // grab a single event with the slug ping-pong
    Event.findOne({ slug: 'ping-pong' }, (err, event) => {

    Chris Sevilleja

    173 posts

    Founder of Google Developer Expert in Web Technologies. Slapping the keyboard until something good happens.