Creating native queries from raw queries

Perhaps its simply a lacking of mongodb technical knowledge, but I dont know where to start to convert a standard mongo db query in to a JSON format the native query console requires.

The reason I need to use a native query is because reading JSON value pairs inside a field is not currently supported in metabase (from googling around).

At the moment I have a collection named 'vulnerabilities' and I want to extract results based on the
contents of a single field which contains JSON.

This raw mongodb query works:

db.vulnerabilities.find({ ‘Details.vulnType’: /Web Application/ })

How do I turn that request in to a format metabase understands in the native query console?


I would suggest you first do a GUI query in Metabase and then click on the button on the query editor to see which query Metabase is firing to Mongo and adapt

Cheers, I gave that a shot but unfortunately until metabase supports JSON fields in MongoDB, that query doesnt appear to be able to be translated.