Setting the collection name dynamically with javascript in mongodb query is not working

Can I set the collection name dynamically based on a search filter value? I have a same aggregate query that I need to run for different collections based on the filter value selected by the user.
Instead of specifying the collection name from the dropdown, I'm using the javascript option and specifying it dynamically. It's evaluating the collection name correctly but the query is not returning any results. Query is also not throwing any errors in the debug logs.

Hey @tushar! This should work, I've set up the collection to be inserted dynamically from both a textInput and a select component. Are you able to try using a text input to see if that works for you? Also just noticed that the query in the screenshot needs to be saved before that new value is sent. Let me know if you are still running into issues here.