Given a schema like this:
UserSchema = new Schema({
name: String,
donations: [
{
amount: Number,
charity: {
type: Schema.Types.ObjectId,
ref: 'charity'
}
}
]
});
I have the (string) ids of a user and of a nonprofit and I want to get the amount the user donated. Im using…
Top comments (0)