Skip to content

Instantly share code, notes, and snippets.


Igor Soarez soarez

View GitHub Profile
View model.js
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var PageSchema = Schema({
title: { type: String, default: '', trim: true },
url: { type: String, default: '', trim: true },
thumbnails: {type: Schema.ObjectId, ref: 'Thumbnail'},
soarez / answer.js
Created Oct 28, 2012 — forked from tdantas/question.js
programming async trick.
View answer.js
// Environment: NodeJS
// Lets suppose that you have a collection of items, and your function must persist all items using the
//database.insert(item, callback ) function. When you finish the task, you should call the callback function.
// If one item raise a error, the callback(err) must be called and never call the callback anymore.
function noop() {}