I need to retrieve data from MongoDB. I am using Spring framework and MongoRepository. My problem is that the data is written to the DB by a different application as 2-element double array. This is the document as seen in MongoDB:
{
"options" : {
"ampWavelength" : 3000,
"continuumWindows" : [
{
"0" : 1140,
"1" : 1150
},
{
"0" : 1275,
"1" : 1280
},
{
"0" : 1320,
"1" : 1330
}]
}
}
The problem is I can't retrieve the array with fields named "0" or "1". Is there any trick to it? So far I have tried creating "continuumWindows" object with fields named "_0" and "_1" or making a "double[][] continuumWindows" variable but neither has worked for me - I either retrieve 0, null or get an error.