I'm creating an aggregation pipeline in Java using MongoDB and, of course, the MongoDB Java driver.
I've figured out how to do what I want in the Mongo Shell, but I'm not sure how to translate this into Java, particularly the whole concept of an object with commas in it, as shown below.
{$project: {sleep: {"date": 1, "hours": 1}}}
Any thoughts on the best way to do this?