30 lines
580 B
JavaScript
30 lines
580 B
JavaScript
mongo = require("./mongoHelp.js")
|
|
|
|
agg = [
|
|
{
|
|
'$unwind': {
|
|
'path': '$txs',
|
|
'preserveNullAndEmptyArrays': true
|
|
}
|
|
}, {
|
|
'$match': {
|
|
'txs.sender': 'dtube'
|
|
}
|
|
}, {
|
|
'$match': {
|
|
'txs.type': 3
|
|
}
|
|
}, {
|
|
'$match': {
|
|
'txs.data.amount': {
|
|
'$gt': 10000
|
|
}
|
|
}
|
|
}
|
|
]
|
|
|
|
mongo.aggregate('avalon5', 'blocks', agg).then(res => {
|
|
res.forEach(element => {
|
|
console.log(element.timestamp, element.txs.data.receiver,element.txs.data.amount,element.txs.data.memo)
|
|
})
|
|
}) |