I have got a database filled with documents like the following :
{
"_id" : ObjectId("56zeffb2abcf7ff24b46"),
"id_thing" : -1,
"data" : {
"info1" : 36.0709427,
"date" : ISODate('2005-11-01T00:33:21.987+07:00'),
"info2" : 24563.87148077
}
}
My find
method returns a List
which I operate some operations over:
for (d <- result_of_find_method_here)
{
val l_d = d("data")
}
But I would like to l_d
a List
which is currently not, and the toList
method does not work.
How do I retrieve all the fields and their value of the data
container as a list?
EDIT:
I have tried multiple methods, and none work because neither applies to AnyRef
which is what I get when I iterate through the l_d
with a foreach
loop.