BasicDBList for the MongoDB Collection

This may seem like a silly question, but I don't know how to do it.

I have a document in 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 an internal array and put them in a Collection (Java Collection , for example List<E> ), but I can not find anything about how to do this (and I searched).

+4
source share
1 answer

This is already java.util.List (BasicDBList implements java.util.List)

http://api.mongodb.org/java/current/com/mongodb/BasicDBList.html

+9
source

Source: https://habr.com/ru/post/1387810/


All Articles