Example blog made with MongoDB



louis vuitton damier azur original

View by objectId ( 531904eb62365b020032ea5f)
By louis vuitton damier azur original on Thu Mar 06 2014 23:29:47 GMT+0000 (UTC)

ovivdz otc cough medicine ratings

View by objectId ( 531658b510b34902002ea8ff)
By bxegsldkti on Tue Mar 04 2014 22:50:29 GMT+0000 (UTC)

rmpwmr hoboken family medicine

View by objectId ( 531200acf751b102001d82f2)
By drbrainpower on Sat Mar 01 2014 15:45:48 GMT+0000 (UTC)

gvgXivwrHSlsTbfNn

View by objectId ( 50884c3e58e0a36c1d000002)
By Austin on Wed Oct 24 2012 20:14:54 GMT+0000 (UTC)

Code sample - how all blog posts were queried

// from web.js
// main page - display all blog posts
// More Mongoose query information here
// http://mongoosejs.com/docs/finding-documents.html

app.get('/', function(request, response) {

    // build the query
    var query = BlogPost.find({});
    query.sort('date',-1); //sort by date in descending order

    // run the query and display blog_main.html template if successful
    query.exec({}, function(err, allPosts){

        // prepare template data
        templateData = {
            posts : allPosts
        };

        // render the card_form template with the data above
        response.render('blog_main.html', templateData);

    });

});
// end of main page