Skip to content

Instantly share code, notes, and snippets.

Igor Soarez soarez

Block or report user

Report or block soarez

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View model.js
var mongoose = require('mongoose');
mongoose.connect('mongodb://localhost/test');
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
soarez / answer.js
Created Oct 28, 2012 — forked from tdantas/question.js
programming async trick.
View answer.js
//Question:
// 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() {}
You can’t perform that action at this time.