Read read= MongoDbIO.read().withUri(<uri>).withBucketAuto(true)
.withDatabase(<db>).withCollection(<collection>);
PCollection<Document> lines = p.apply(read);
How to convert lines to tablerows dynamically without fetching each line and setting the table row like this:
String offer_id=document.getString("oid");
TableRow row;
row=new TableRow().set("offerId", offer_id)