Skip to content

Instantly share code, notes, and snippets.

View basedalexander's full-sized avatar
🎯
Focusing

Alex Based basedalexander

🎯
Focusing
View GitHub Profile
// Get sum of a certain field across all the documents in a collection
db.getCollection('simple-arb').aggregate([
{
$match: {
closed: {
$eq: true
}
}
}, {
ssh -i /path/to/my.pem myuser@host -t 'sudo docker exec -it container_name /bin/bash'
db.getCollection('simple-arb').updateMany({},{"$unset":{"createDateDick":1}})
https://gist.github.com/webinista/812c20247a6c21e639ce
db.getCollection('collName').remove({
timestamp:{
$lte : 1551126714784.0
}
})
db.getCollection('collName').find({}).sort({ timestamp: -1 }).limit(1)