This is the JSON structure, note that the last entry has 2 multidimensional arrays in it, one for chr 10 and one for chr 12:
{
"_id": "9oFvJYeG9wpdBYunu",
"segments": [{
"chr": "7",
"start": "140422294",
"end": "155048283",
"length": "29.1",
"snps": "1666"
}]
} {
"_id": "HK4WXc5mR6fyesjpP",
"segments": [{
"chr": "10",
"start": "83865742",
"end": "90981118",
"length": "6.3",
"snps": "1380"
}]
} {
"_id": "3N4Z2dtX5PiuqmCFv",
"segments": [{
"chr": "10",
"start": "83865742",
"end": "90981118",
"length": "6.3",
"snps": "1380"
}, {
"chr": "12",
"start": "32853998",
"end": "44834540",
"length": "5.1",
"snps": "1623"
}]
}
How can I identify all segments with chr = 10? I want to get the detailed information about the elements with chr = 10.
I want to return the following fields:
_id, chr, start, end, length, snps
back. How can I query this in Meteor? I tried $elemMatch
an $in
but to no avail.
Thanks in advance for your help! Cross posted to SO as well: http://stackoverflow.com/questions/32893342/mongodb-how-to-find-and-return-elements-in-a-multidimensional-array
P.S.: this is on the server side, not sure if that’s important