-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtext.bson
More file actions
1 lines (1 loc) · 7.56 KB
/
text.bson
File metadata and controls
1 lines (1 loc) · 7.56 KB
1
[[{"Key":"$facet","Value":[{"Key":"items","Value":[[{"Key":"$match","Value":[{"Key":"collection_address","Value":"0x9841faa1133da03b9ae09e8daa1a725bc15575f0"}]}],[{"Key":"$lookup","Value":[{"Key":"from","Value":"collections"},{"Key":"localField","Value":"collection_address"},{"Key":"foreignField","Value":"contract"},{"Key":"as","Value":"collection"}]}],[{"Key":"$unwind","Value":[{"Key":"path","Value":"$collection"},{"Key":"preserveNullAndEmptyArrays","Value":true}]}],[{"Key":"$lookup","Value":[{"Key":"from","Value":"marketplace_listings"},{"Key":"localField","Value":"token_id"},{"Key":"foreignField","Value":"token_id"},{"Key":"pipeline","Value":[[{"Key":"$match","Value":[{"Key":"collection_contract","Value":"0x9841faa1133da03b9ae09e8daa1a725bc15575f0"},{"Key":"status","Value":0}]}],[{"Key":"$skip","Value":0}],[{"Key":"$limit","Value":1}]]},{"Key":"as","Value":"listing_for_sales"}]}],[{"Key":"$lookup","Value":[{"Key":"from","Value":"marketplace_offers"},{"Key":"localField","Value":"token_id"},{"Key":"foreignField","Value":"token_id"},{"Key":"pipeline","Value":[[{"Key":"$match","Value":[{"Key":"collection_contract","Value":"0x9841faa1133da03b9ae09e8daa1a725bc15575f0"},{"Key":"status","Value":0}]}],[{"Key":"$skip","Value":0}],[{"Key":"$limit","Value":100}]]},{"Key":"as","Value":"make_offers"}]}],[{"Key":"$addFields","Value":[{"Key":"price_erc20","Value":"$listing_for_sales"}]}],[{"Key":"$unwind","Value":[{"Key":"path","Value":"$price_erc20"},{"Key":"preserveNullAndEmptyArrays","Value":true}]}],[{"Key":"$addFields","Value":[{"Key":"buyable","Value":[{"Key":"$cond","Value":[[{"Key":"$or","Value":[[{"Key":"$eq","Value":[[{"Key":"$ifNull","Value":["$price_erc20",0]}],0]}]]}],false,true]}]},{"Key":"price","Value":[{"Key":"$cond","Value":[[{"Key":"$or","Value":[[{"Key":"$eq","Value":[[{"Key":"$ifNull","Value":["$price_erc20",0]}],0]}]]}],0,[{"Key":"$toDouble","Value":"$price_erc20.price"}]]}]},{"Key":"erc20","Value":"$price_erc20.erc_20_token"}]}],[{"Key":"$addFields","Value":[{"Key":"price","Value":[{"Key":"$divide","Value":["$price",[{"Key":"$pow","Value":[10,18]}]]}]}]}],[{"Key":"$lookup","Value":[{"Key":"from","Value":"bns"},{"Key":"localField","Value":"owner"},{"Key":"foreignField","Value":"resolver"},{"Key":"pipeline","Value":[[{"Key":"$skip","Value":0}],[{"Key":"$limit","Value":1}]]},{"Key":"as","Value":"bns_data"}]}],[{"Key":"$lookup","Value":[{"Key":"from","Value":"bns_default"},{"Key":"localField","Value":"owner"},{"Key":"foreignField","Value":"resolver"},{"Key":"pipeline","Value":[[{"Key":"$skip","Value":0}],[{"Key":"$limit","Value":1}]]},{"Key":"as","Value":"bns_default"}]}],[{"Key":"$addFields","Value":[{"Key":"buyable","Value":[{"Key":"$cond","Value":[[{"Key":"$or","Value":[[{"Key":"$eq","Value":[[{"Key":"$ifNull","Value":["$price_erc20",0]}],0]}]]}],false,true]}]},{"Key":"price","Value":[{"Key":"$cond","Value":[[{"Key":"$or","Value":[[{"Key":"$eq","Value":[[{"Key":"$ifNull","Value":["$price_erc20",0]}],0]}]]}],0,[{"Key":"$toDouble","Value":"$price_erc20.price"}]]}]},{"Key":"erc20","Value":"$price_erc20.erc_20_token"},{"Key":"name","Value":[{"Key":"$cond","Value":[{"Key":"if","Value":[{"Key":"$eq","Value":["$name",""]}]},{"Key":"then","Value":[{"Key":"$cond","Value":[{"Key":"if","Value":[{"Key":"$gt","Value":["$token_id_int",1000000]}]},{"Key":"then","Value":[{"Key":"$concat","Value":["$collection.name"," #",[{"Key":"$toString","Value":[{"Key":"$mod","Value":["$token_id_int",1000000]}]}]]}]},{"Key":"else","Value":[{"Key":"$concat","Value":["$collection.name"," #","$token_id"]}]}]}]},{"Key":"else","Value":"$name"}]}]}]}],[{"Key":"$sort","Value":[{"Key":"buyable","Value":-1},{"Key":"price","Value":1},{"Key":"token_id_int","Value":-1}]}],[{"Key":"$skip","Value":0}],[{"Key":"$limit","Value":10}]]},{"Key":"count","Value":[[{"Key":"$match","Value":[{"Key":"collection_address","Value":"0x9841faa1133da03b9ae09e8daa1a725bc15575f0"}]}],[{"Key":"$lookup","Value":[{"Key":"from","Value":"collections"},{"Key":"localField","Value":"collection_address"},{"Key":"foreignField","Value":"contract"},{"Key":"as","Value":"collection"}]}],[{"Key":"$unwind","Value":[{"Key":"path","Value":"$collection"},{"Key":"preserveNullAndEmptyArrays","Value":true}]}],[{"Key":"$lookup","Value":[{"Key":"from","Value":"marketplace_listings"},{"Key":"localField","Value":"token_id"},{"Key":"foreignField","Value":"token_id"},{"Key":"pipeline","Value":[[{"Key":"$match","Value":[{"Key":"collection_contract","Value":"0x9841faa1133da03b9ae09e8daa1a725bc15575f0"},{"Key":"status","Value":0}]}],[{"Key":"$skip","Value":0}],[{"Key":"$limit","Value":1}]]},{"Key":"as","Value":"listing_for_sales"}]}],[{"Key":"$lookup","Value":[{"Key":"from","Value":"marketplace_offers"},{"Key":"localField","Value":"token_id"},{"Key":"foreignField","Value":"token_id"},{"Key":"pipeline","Value":[[{"Key":"$match","Value":[{"Key":"collection_contract","Value":"0x9841faa1133da03b9ae09e8daa1a725bc15575f0"},{"Key":"status","Value":0}]}],[{"Key":"$skip","Value":0}],[{"Key":"$limit","Value":100}]]},{"Key":"as","Value":"make_offers"}]}],[{"Key":"$addFields","Value":[{"Key":"price_erc20","Value":"$listing_for_sales"}]}],[{"Key":"$unwind","Value":[{"Key":"path","Value":"$price_erc20"},{"Key":"preserveNullAndEmptyArrays","Value":true}]}],[{"Key":"$addFields","Value":[{"Key":"buyable","Value":[{"Key":"$cond","Value":[[{"Key":"$or","Value":[[{"Key":"$eq","Value":[[{"Key":"$ifNull","Value":["$price_erc20",0]}],0]}]]}],false,true]}]},{"Key":"price","Value":[{"Key":"$cond","Value":[[{"Key":"$or","Value":[[{"Key":"$eq","Value":[[{"Key":"$ifNull","Value":["$price_erc20",0]}],0]}]]}],0,[{"Key":"$toDouble","Value":"$price_erc20.price"}]]}]},{"Key":"erc20","Value":"$price_erc20.erc_20_token"}]}],[{"Key":"$addFields","Value":[{"Key":"price","Value":[{"Key":"$divide","Value":["$price",[{"Key":"$pow","Value":[10,18]}]]}]}]}],[{"Key":"$lookup","Value":[{"Key":"from","Value":"bns"},{"Key":"localField","Value":"owner"},{"Key":"foreignField","Value":"resolver"},{"Key":"pipeline","Value":[[{"Key":"$skip","Value":0}],[{"Key":"$limit","Value":1}]]},{"Key":"as","Value":"bns_data"}]}],[{"Key":"$lookup","Value":[{"Key":"from","Value":"bns_default"},{"Key":"localField","Value":"owner"},{"Key":"foreignField","Value":"resolver"},{"Key":"pipeline","Value":[[{"Key":"$skip","Value":0}],[{"Key":"$limit","Value":1}]]},{"Key":"as","Value":"bns_default"}]}],[{"Key":"$addFields","Value":[{"Key":"buyable","Value":[{"Key":"$cond","Value":[[{"Key":"$or","Value":[[{"Key":"$eq","Value":[[{"Key":"$ifNull","Value":["$price_erc20",0]}],0]}]]}],false,true]}]},{"Key":"price","Value":[{"Key":"$cond","Value":[[{"Key":"$or","Value":[[{"Key":"$eq","Value":[[{"Key":"$ifNull","Value":["$price_erc20",0]}],0]}]]}],0,[{"Key":"$toDouble","Value":"$price_erc20.price"}]]}]},{"Key":"erc20","Value":"$price_erc20.erc_20_token"},{"Key":"name","Value":[{"Key":"$cond","Value":[{"Key":"if","Value":[{"Key":"$eq","Value":["$name",""]}]},{"Key":"then","Value":[{"Key":"$cond","Value":[{"Key":"if","Value":[{"Key":"$gt","Value":["$token_id_int",1000000]}]},{"Key":"then","Value":[{"Key":"$concat","Value":["$collection.name"," #",[{"Key":"$toString","Value":[{"Key":"$mod","Value":["$token_id_int",1000000]}]}]]}]},{"Key":"else","Value":[{"Key":"$concat","Value":["$collection.name"," #","$token_id"]}]}]}]},{"Key":"else","Value":"$name"}]}]}]}],[{"Key":"$group","Value":[{"Key":"_id","Value":[{"Key":"collection_address","Value":"$collection_address"}]},{"Key":"all","Value":[{"Key":"$sum","Value":1}]}]}]]}]}],[{"Key":"$unwind","Value":[{"Key":"path","Value":"$count"},{"Key":"preserveNullAndEmptyArrays","Value":true}]}],[{"Key":"$addFields","Value":[{"Key":"total_item","Value":"$count.all"}]}],[{"Key":"$project","Value":[{"Key":"count","Value":0}]}]]