Using the MongoDB Java driver I would like to retrieve a validator defined for a collection. In mongo Shell this can be easily achieved by running db.getCollectionInfos({name: "MyTestCollection"})[0].options.validator; as described here.
What I miss is a similar method on the MongoDatabase class or a Database Command I can run with the MongoDatabase.runCommand(...) method.
What do I miss? How to retrieve that information in Java?