Question

Is it possible to get a list of all the fields in a DBObject? I have searched through the documentation and can't find anything. Thanks.

Was it helpful?

Solution

BasicDBObject implements the java.util.Map interface. So, you can use the Map's keySet() method to get the list of keys (or "fields").

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top