mongo = require("./mongoHelp.js") // August 16th 2021 // 1629061200000 agg = [ { '$unwind': { 'path': '$txs', 'preserveNullAndEmptyArrays': false } }, { '$match': { 'timestamp': { '$gt': 1629061200000 } } }, { '$match': { 'txs.type': 19 } }, { '$match': { 'txs.data.tip': { '$lt': 20 } } } ] mongo.aggregate('avalon5', 'blocks', agg).then(res => { res.forEach(element => { console.log(element) }) })