We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
bug
What is the current behavior?
The minimize option of a referenced schema is overriden by it's parent.
If the current behavior is a bug, please provide the steps to reproduce.
Take this schema:
const userSchema = mongoose.Schema({ adress: { type: mongoose.Schema.ObjectId, ref: 'adresses' } }) const adressSchema = mongoose.Schema({ zip: { type: String }, country: { type: Object, default: {}} }, {minimize: false})
if I query userSchema and populate the adress field
console.log(user) outputs { adress: {zip: "1234"} }
console.log(user)
{ adress: {zip: "1234"} }
console.log(user.adress) outputs {zip: "1234", country: {} }
console.log(user.adress)
{zip: "1234", country: {} }
What is the expected behavior?
referenced schemas options should be taken into account instead of overriden.
What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.
mongoose: 5.9.4 mongodb: 4.2.8 node: 10.20.0
mongoose
5.9.4
mongodb
4.2.8
node
10.20.0
The text was updated successfully, but these errors were encountered:
test(document): repro #9405
57a015a
b018d2d
No branches or pull requests
bug
What is the current behavior?
The minimize option of a referenced schema is overriden by it's parent.
If the current behavior is a bug, please provide the steps to reproduce.
Take this schema:
if I query userSchema and populate the adress field
console.log(user)
outputs{ adress: {zip: "1234"} }
console.log(user.adress)
outputs{zip: "1234", country: {} }
What is the expected behavior?
referenced schemas options should be taken into account instead of overriden.
What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.
mongoose
:5.9.4
mongodb
:4.2.8
node
:10.20.0
The text was updated successfully, but these errors were encountered: