how to read all fields and their type of a mongo db collection using java? collection is as following. Each document may not have all fields
{ "_id" : { "oid" : "5117fa92f1d3a4093d0d3903"} },
{ "_id" : { "oid" : "5117fa93f1d3a4093d0d3904"} , "ip" : "127.0.0.1" },
{ "_id" : { "oid" : "5117fa93f1d3a4093d0d3904"} , "ip" : "127.0.0.1" ,"price" : 2000}