Created
August 21, 2011 07:21
-
-
Save hamin/1160285 to your computer and use it in GitHub Desktop.
mongoose.coffee
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
Message = new Schema({content: String,nickname: String,created_at: Date}) | |
Picture = new Schema({user: ObjectId,title: String,url: String,start_at: Date,end_at: Date,messages: [Message],created_at: Date,updated_at: Date}) | |
PhotoAccount = new Schema({token: String,token_secret: String,provider: String,username: String,domain: String,avatar: String}) | |
User = new Schema({token: String,token_secret: String,username: String,domain: String,avatar: String,created_at: Date,updated_at: Date,photo_accounts: [PhotoAccount]}) | |
picture = mongoose.model('Picture', Picture) | |
user = mongoose.model('User', User) | |
picture.findOne() # { model: { [Function: model] modelName: 'Picture' }, op: 'findOne' } |
picture.findOne(function(err, pic) { console.log(pic); })
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
why is it not returning the actual record?