Native mongo query to get data from last 30 days

I have a collection in MongoDB that contains a date field and I would like to retrieve data from the last 30 days. This is pretty easy in the visual editor, but due to the content of my query I need to do that native. When I turn the question I made using GUI into a native question using the filter "previous 30 days" it seems like the date interval is hardcoded... I wonder if there's a way to get the data from "previous 30 days" in a native question. Thank you.

P.S.: there's an older topic with a very similar question which is still open