Skip to content

Instantly share code, notes, and snippets.

@danared
Created October 29, 2015 20:10
Show Gist options
  • Save danared/cd7250a75ea9b1d633e0 to your computer and use it in GitHub Desktop.
Save danared/cd7250a75ea9b1d633e0 to your computer and use it in GitHub Desktop.
db.orders.findOne({price: {$type: 2}});
{
"_id": 3500,
"item": "abc",
"price": "free",
"quantity": 5
}
> db.orders.update(
{_id: 3500},
{$set: {quantity: 12}});
Updated 1 existing record(s) in 5ms
WriteResult({
"nMatched": 1,
"nUpserted": 0,
"nModified": 1
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment