Created
April 7, 2023 05:50
-
-
Save vanleantking/912643b76e1b12b658ec775c27f54944 to your computer and use it in GitHub Desktop.
sum filter nan mongodb aggregate
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
db.getCollection("fb_report_detail").aggregate([ | |
{"$match":{ | |
"campaign_id":{"$in":["23852528555800329"]}, | |
"adset_id":{"$in":["23852528555870329","23852661751140329"]}}}, | |
{ '$group': { | |
'_id': '$ad_id', | |
'inline_link_clicks': { | |
'$sum': { | |
'$cond': [ | |
{ '$eq': ['$inline_link_clicks', NaN]}, | |
0, | |
'$inline_link_clicks' | |
] | |
} | |
} | |
}}, | |
]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment