Skip to content

Instantly share code, notes, and snippets.

@EyeOfPython
Last active May 4, 2019 19:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EyeOfPython/e7cc827e7780aa01c59158e813ca8d6f to your computer and use it in GitHub Desktop.
Save EyeOfPython/e7cc827e7780aa01c59158e813ca8d6f to your computer and use it in GitHub Desktop.
{
"v": 3,
"q":
{
"db": ["c", "u"],
"aggregate": [
{"$match":{
"in.h0": "45584348",
"in.b1.op": 82,
"slp.valid": true,
"slp.detail.tokenIdHex": "28022a6d389f3ecd5ae96fb3bc63083e95d2f2ebbffdb544fe186125640eb117"
}},
{"$addFields": {
"tx_hash": {"$concat": ["$tx.h", ":1"]}
}},
{"$lookup": {
"from": "utxos",
"localField": "tx_hash",
"foreignField": "utxo",
"as": "found_utxo"
}},
{
"$match": { "found_utxo": { "$ne": [] } }
},
{"$addFields": {
"exch_input": {
"$arrayElemAt": [
{"$filter": {
"input": "$in",
"as": "input",
"cond": {
"$and": [
{"$eq": ["$$input.b0", "RVhDSA=="]},
{"$eq": ["$$input.b1.op", 82]}
]
}
}},
0
]
}
}},
{"$project": {
"tx_hash": "$tx_hash",
"power": "$exch_input.b2",
"price": "$exch_input.b3",
"address": "$exch_input.b4",
"blk": "$blk"
}}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment