I want to add a field filter at the end of the query. Here I have hard-coded a value because the value is achieved by joining the tables. can we do this in Metabase. Field filter works without aliasing so how would it interpret a joined table entry? I have tried adding it but it ends up giving nothing
I have already moved the match clause below the project and it works on the given hardcoded value.
VendorId is a achieved by joining two tables. and now I want a filter on vendor id using a field filter.
,
[[
{
"$match":{"vendorid" : {{id}}}
}
]]
The above does it by using the id as a text field. but i want a dropdown.
if i change it to this and make it a field filter on id in the vendor table, it fails to give me the result.
But again, I would highly recommend that you just create Views on your database, so you can use regular "tables" and the GUI in Metabase. It would save you so much problems.
Does the filter fails to work if the category has space?
I have a category with two words separated by space.
Whenever i put in a name, it gives me an empty result.
@flamber It was not related to mongo. it was related to Metabase. Posting the solution so that others can get benefit.
So basically, if the case of the name matters. It should be
@Anum It was not related to Metabase. It was related to Mongo and the query you wrote. Yes, Mongo is case-sensitive, so in that sense, your queries should also be.