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
I triying the following population/projection and work fine
modelBaby.findOne({'userId': req.user.data._id, '_id': req.params.id}) .populate('categories._categoryId', { levels:{ $elemMatch:{ name: 'PURPLE' } } })
But i need name as a variable something like:
modelBaby.findOne({'userId': req.user.data._id, '_id': req.params.id}) .populate('categories._categoryId', { levels:{ $elemMatch:{ // over heree !! name: 'categories._levelName' or this._levelName } } })
the scheme ref is
const babyCategory = new mongoose.Schema( { answer: {type: String}, _categoryId: {type: Schema.Types.ObjectId, required: true, ref: 'category'}, _categoryName: {type: String, required: true}, _levelName: {type: String, required: true} }, {versionKey: false, _id : false} );
This is possible ? or how is the best way to approach this
Thanks btw =D
The text was updated successfully, but these errors were encountered:
For now you would have to fetch it manually and match on it. I'll label this a feature request for 4.12
Sorry, something went wrong.
No branches or pull requests
I triying the following population/projection and work fine
But i need name as a variable something like:
the scheme ref is
This is possible ? or how is the best way to approach this
Thanks btw =D
The text was updated successfully, but these errors were encountered: