Way to deep traverse a Groovy object with dot in string using GPath
问题 The situation I have is that I'm querying MongoDB with a string for a field that is more than one level deep in the object hierarchy. This query must be a string. So for example I'm querying for something like this in Groovy: def queryField = 'a.b.c' //this is variable and can be different every time def result = mongodb.collection.findOne([queryField:5]) The problem no arises that in the result I want to find the value of the nested field. With GPath I could go one level deep and get a's