New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Schema, array, default value (default value "[]" is not working) #250
Comments
At least in master, this works fine for me.. except it returns a MongooseArray so it's full of lots of other craziness :) Not just the value. What version are you running? |
var mongoose = require('mongoose'); mongoose.connect('mongodb://localhost/dbTest'); var arrayTestSchema = new Schema({
}); mongoose.model('ArrayTest', arrayTestSchema); var myTest = new ArrayTest(); myTest.Title = 'Project'; console.log(myTest); mongoose.connection.close(); |
I'm running 1.0.12, npm version. Don't understant what you want to point out pradeepthundiyil. |
It's failing because you're not accessing your document instance. I've commented out your console.log and replaced it with the correct one.
|
lol, ok i see, yesterday was a bad day for me. Thanks for pointing this out =) |
@bnoguchi what about the type of array items? |
displays "undefined"
The text was updated successfully, but these errors were encountered: