Select query from map data structer included entity

n1ql
query

#1

I have document which score and file map entity included. the keys of those maps are is dynamic student ids. how can i retrieve for specific document for specify class and student id included document like
getScoresByClassIDAndStudentId() .here 100 , 101 is subject ids. can some one help with n1ql query

here my java level entity

public class StudentDetails {

private String classid;

@Field
private Map<Long, Map<String, String>> Scores;

  @Field
private Map<Long, Map<String, BigDecimal>> files;

}

result documnt

{
“classID” : 1,
“Scores”: {

"1": {
    "100": {
      "scale": 2,
      "intCompact": 297,
      "_class": "java.math.BigDecimal",
      "precision": 3
    },
    "101": {
      "scale": 2,
      "intCompact": 297,
      "_class": "java.math.BigDecimal",
      "precision": 3
    }
  }  ,


  "2": {

    "100": {
      "scale": 2,
      "intCompact": 297,
      "_class": "java.math.BigDecimal",
      "precision": 3
    },
    "101": {
      "scale": 2,
      "intCompact": 297,
      "_class": "java.math.BigDecimal",
      "precision": 3
    }

  } 

}

“files”: {

"1": {
    "100": {
      "scale": 2,
      "intCompact": 297,
      "_class": "java.math.BigDecimal",
      "precision": 3
    },
    "101": {
      "scale": 2,
      "intCompact": 297,
      "_class": "java.math.BigDecimal",
      "precision": 3
    }
  }  ,


  "2": {

    "100": {
      "scale": 2,
      "intCompact": 297,
      "_class": "java.math.BigDecimal",
      "precision": 3
    },
    "101": {
      "scale": 2,
      "intCompact": 297,
      "_class": "java.math.BigDecimal",
      "precision": 3
    }

  } 

}
}


#2

N1QL has has all the functionalities to select-join-project from your documents using various criteria. See the examples at:

https://query-tutorial.couchbase.com/tutorial/#1

Also: https://training.couchbase.com/online

wrt data modeling, within scores, I’d recommend using arrays and having each of the scores as objects within the the arrays.