How to add filters to MongoDB query? #6963
Unanswered
GabrielSalernoILARI
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
On the website and help sections of redash, it says you have to project a column with the "::filter" keyword added to the end, like this:
Well I have 2 problems: when trying to do this with a new column generated with count ($sum), not only does the filter section not appear in the result, but the whole column disappears:
here when adding ::filter to TotalProducts under $project the column (that would otherwise appear and work normally) is not present in the table at all.
The other issue I've found is when trying the filtering without "fields":
here the filter section appears, but without using "fields", there are duplicates of both the filters and columns. i.e. instead of having 2 columns, DESCRIZIONE AREA and DESCRIZIONE BENE DA OSPEDALE, i have n*2 columns and n filters, where n is the number of rows found in the database (in my case 40 for testing). To avoid this you should use fields as far as I know but doing that simply doesn't show the filters nor the filtered column.
Beta Was this translation helpful? Give feedback.
All reactions