Created
January 1, 2018 07:16
-
-
Save SamWSoftware/1b78419a7c8be8e05b58c0204cc11823 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Survey.updateOne( | |
{ | |
_id: match.surveyId, | |
recipients: { | |
$elemMatch: { email: email, responded: false } | |
} | |
}, | |
{ | |
$inc: { [match.choice]: 1 }, | |
$set: { "recipients.$.responded": true }, | |
lastResponded: new Date() | |
} | |
).exec(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment