This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var mongoose = require('mongoose'); | |
mongoose.connect('localhost', 'testing_emitUpdate'); | |
var Schema = mongoose.Schema; | |
var schema = new Schema({ | |
name: String | |
}); | |
// plumbing | |
schema.pre('save', function (next) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var mongoose = require('./../mongoose'); | |
var Schema = mongoose.Schema; | |
var sleep = 1000; | |
var timer; | |
var db = mongoose.createConnection(); | |
db.on('error', function () { | |
// error on startup | |
console.error('conn error', arguments); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var mongoose = require('mongoose'); | |
var Schema = mongoose.Schema; | |
mongoose.connect('localhost', 'testing_testmodelfindtoObject'); | |
mongoose.connection.on('error', function () { | |
console.error(arguments); | |
}); | |
var schema = new Schema({ | |
name: String |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var mongoose = require('./../mongoose'); | |
var Schema = mongoose.Schema; | |
mongoose.connect('localhost', 'testing_10777676'); | |
mongoose.connection.on('error', function () { | |
console.error(arguments); | |
}); | |
var schema = new Schema({ | |
name: String |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var mongoose = require('./../mongoose'); | |
var Schema = mongoose.Schema; | |
mongoose.connect('localhost', 'testing_10818776'); | |
mongoose.connection.on('error', function () { | |
console.error(arguments); | |
}); | |
var schema = new Schema({ | |
name: String |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var assert = require('assert') | |
var mongoose = require('./../mongoose'); | |
console.error( | |
'\n===========' | |
, ' mongoose version: ' | |
, mongoose.version | |
, '========\n\n' | |
); | |
var Schema = mongoose.Schema; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var mongoose = require('mongoose'); | |
var Schema = mongoose.Schema; | |
mongoose.connect('localhost', 'testing_oops'); | |
mongoose.connection.on('error', function () { | |
console.error(arguments); | |
}); | |
var schema = new Schema({ | |
name: String |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var jade = require('jade') | |
, mongoose =require('mongoose') | |
, Schema = mongoose.Schema | |
var s = new Schema({ a: String }); | |
s.virtual('asdf').get(function () { | |
return 'i am a vritual' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var mongoose = require('./../mongoose'); | |
console.error( | |
'\n===========', ' mongoose version: ', mongoose.version, '========\n\n' | |
); | |
var Schema = mongoose.Schema; | |
mongoose.connect('localhost', 'testing_knowIfItemIsAdded'); | |
mongoose.connection.on('error', function () { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var mongoose = require('mongoose'); | |
var Schema = mongoose.Schema; | |
mongoose.connect('localhost', 'testing_876'); | |
mongoose.connection.on('error', function () { | |
console.error(arguments); | |
}); | |
var schema = new Schema({ | |
name: String | |
, active : {type:Boolean, default: false } |