Java implements nested query of mongodb data, preferably using springdata mongodb

there are two record: entries as follows

  1. query condition is type=gz--> detai is a List, there is an obj, query condition in this obj, and this filed is a List, depending on whether the value in it conforms to
  2. .
  3. query the entire document of all type with gz
  4. result should only find the first item, and the second item does not conform to
  5. .
  6. how to implement it, it"s best to use springdata mongdb

Thank you

{
    "name": "test",
    "location":"11",
    "isTrue":"11",
    "details": [
        {
        "remark": "121221",
        "type": ["bj","sh"],
        "group": ["123","123"]
        },
        {
        "remark": "321321",
        "type": ["sh","gz"],
        "group": ["123","123"]
        }
    ]
}
{
    "name": "test",
    "location":"11",
    "isTrue":"11",
    "details": [
        {
        "remark": "121221",
        "type": ["bj","sh","sz"],
        "group": ["123","123"]
        },
        {
        "remark": "321321",
        "type": ["sh"],
        "group": ["123","123"]
        }
    ]
}
Menu