Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
I am trying to use $cond in Redash to transform a true/false/null to a meaningful value for a report. When I perform the query I only ever get the false case.
This is my query below. I have included the "isSuggestedProgram" in the projection just so I can verify the values for now.
All results show "Custom" as the result regardless of the value of isSuggestedProgram. What is wrong with the way I am doing the $cond?
"collection": "Program",
"aggregate": [
"$project": {
"isSuggestedProgram": "$isSuggestedProgram",
"suggested": {
"$cond": {
"if": {
"$eq": [
"$isSuggestedProgram", "true"
"then": "Suggested",
"else": "Custom"
–
–
Thanks for contributing an answer to Stack Overflow!
-
Please be sure to
answer the question
. Provide details and share your research!
But
avoid
…
-
Asking for help, clarification, or responding to other answers.
-
Making statements based on opinion; back them up with references or personal experience.
To learn more, see our
tips on writing great answers
.