I Have been trying several methods in the Mongo documentation manually and it does not seem to solve my issue. Here is a structure of my data for reference
"loopback": [
{
"_date": "some date",
"dutTestParams": [],
"_id": "5f680665dfbfb74e78cae175",
"paramId": "dummyid",
"jtagApbStatus": "true",
"dutYaml": "dummy_yaml",
"dutSequenceId": "dummy_sequence",
"dutGitVersion": "1.0.1",
"guiVersion": "1.0",
"projectId": "alphacore",
"jobId": "id",
"pvt": "dummypvt",
"rate": 1,
"refclk": 1,
"channelLoss": 1,
"voltage1": 1,
"voltage2": 0.5,
"voltage3": 0.5,
"temp": 10,
"txwidth": 8,
"rxwidth": 8,
"name": "loopback",
"data": [
{
"onLane": [
1
],
"_id": "5f680675dfbfb74e78cae17c",
"chpid": "chip1",
"loopbackname": "BER",
"loopbackvalue": 0,
"laneid": 1,
"iteration": 1
},
{
"onLane": [
1
],
"_id": "5f680675dfbfb74e78cae17d",
"chipid": "chip2",
"loopbackname": "BER",
"loopbackvalue": 0,
"laneid": 1,
"iteration": 1
},{....}, ....., {....}]
Basically i have a parent document. There is test data stored in the parent header document. This data is related to the test, so it does not necessarily have to be BER. It can be other test points. Further, it contains all the chips tested in the test.
I can filter the data once queried, this is trivial. However, is there any way I can make a specific query? What I ideally want is to be able to do something along these lines:
db.testdata.find({jobid:"some id", data.0.chipid:"chip1"})
so the query returns the header parent document and only sub documents that have chipid == chip1. When I attempt something along these lines, I get all sub documents, which is not what I want.
Any experienced help will be very much appreciated!