Created
June 20, 2011 22:42
-
-
Save bnoguchi/1036781 to your computer and use it in GitHub Desktop.
Example showing that mongoose GH-386 can't be re-produced
This file contains 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') | |
, Schema = mongoose.Schema ; | |
mongoose.connect('mongodb://localhost/test'); | |
var NewsModelSchema = new Schema({ | |
name: String | |
, title: String | |
}); | |
var NewsModel = mongoose.model('NewsModel', NewsModelSchema); | |
NewsModel.create({name: 'one', title: 'two'}, function (err, user) { | |
NewsModel.find(null, {id: 1, name: 1}, function (err, res) { | |
console.log(res); | |
mongoose.disconnect(); | |
}); | |
}); | |
// Console output is: | |
// => [ { name: 'one', _id: 4dffcc678125f54d04000001 } ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment