Skip to content

Instantly share code, notes, and snippets.

@kaworu
Created March 18, 2014 11:56
Show Gist options
  • Save kaworu/9618630 to your computer and use it in GitHub Desktop.
Save kaworu/9618630 to your computer and use it in GitHub Desktop.
collection.update(
{bookings: {$elemMatch: {
_id: unconfirmed._id,
expire_at: {$gte: now},
confirmed_at: {$exists: false}
}}},
{$set: {'bookings.$.confirmed_at': new Date()}},
callback
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment