Does mongoDB has a parse library

I’m trying to find a parser (better on java) for any query that parses the query and creates an abstract syntax tree, something like that:

var ast = parse('{"foo": "bar"}');
assert.deepEqual(ast, {
'pos': 'expression',
'clauses': [
'pos': 'leaf-clause',
'key': 'foo',
'value': {
'pos': 'leaf-value',
'value': 'bar'

does mongoDb have a library doing that? (better for java)

Hi @to_ad

Please have a look at and see whether that suits your needs.