Nicely building a MongoDB query in Java
To avoid the hellish look of queries with infinitely nested DBObjects and strings as operands, the MongoDB Java driver provides an helper class called QueryBuilder which allows to specify the more commonly used search criteria with a simpler API. Here's the same program from the previous post, modified to build the query nicely:
https://gist.github.com/nofatclips/5638337
Better, uh?















