I have two documents, buyers
and submission
(submissions are a subdocument of buyers).
mongoose.model('Buyer',{
username: String,
credit: Number,
forms:[mongoose.model('Submission').schema]
});
and
mongoose.model('Submission',{
title: String,
bid: Number,
});
Each buyer has a credit
attribute and each submission
has a bid attribute. I want to build a query that will search for any submission where the bid is lower than its parent.credit
Is it possible to find based on the comparison of parent-child attributes?