This may seem like a dumb question but I don't know how to do this.
I have a document in a DBCollection
that looks like this:
{
"_id" : ObjectId("4ef4ee517e696a48037861c8"),
"income" : 2500,
"month" : "2011-12",
"expenses" : [
{
"id" : 1,
"category" : "EMERGENCY",
"type" : "SAVING",
"date" : "2011-12-23 10:25:30",
"value" : 0.25"
} ]
}
I want to get all the elements of the inner array and put them into a Collection
(Java Collection
, e.g List<E>
), but I can't seem to find anything on how to do it (and I've searched).
It is already a java.util.List (BasicDBList implements java.util.List)
http://api.mongodb.org/java/current/com/mongodb/BasicDBList.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With