Q: How to get rid of the mongo IDs when converting a collection to json I'm using the mongo java API to convert a collection to json: 
MongoCollection<Document> coll = db.getCollection("day_EURUSD");
FindIterable<Document> fi = coll.find();
System.out.println(fi.first().toJson());

However the outcome still contains nongoDB 'clutter':
{ "_id" : { "$oid" : "565d90808b821237efdc39cb" }, "currencyPairs" : [{ "a....

How can I elegently get rid of _id and $oid so that i'm back to a 'normal' json?
Thanks

A: Try this:
   MongoCollection<Document> coll = db.getCollection("day_EURUSD");
    FindIterable<Document> fi = coll.find();
    fi.forEach(new Block<Document>() {
        @Override
        public void apply(final Document document) {
                    // Suppress the DB Id column of the query result.
               document.remove("_id");
        }
    });
    ...

