My document contains nearly seven levels of the document in MongoDB, now I need to write a query to check all conditions like, subject=java, topic=oops, level=l1, complexity=easy, questionType=mcq
based on this requirement display all questions in the collection.
Any one please help me out, Thanks in advance.
{
"_id" : ObjectId("59f71b4d0bec333e1707a8d3"),
"_class" : "com.wipro.domain.QuestionBank",
"subjectLists" : [
{
"subject" : "java",
"topicList" : [
{
"topic" : "oops",
"levelList" : [
{
"level" : "l1",
"complexityList" : [
{
"complexity" : "easy",
"questionTypeList" : [
{
"questionType" : "mcq",
"questionList" : [
{
"_id" : "2",
"question" : "2st question",
"options" : [
{
"a" : "1",
"b" : "2",
"c" : "3",
"d" : "4"
}
],
"correctAnswer" : "b",
"marksAlloted" : "1"
}
]
}
]
}
]
}
]
}
]
}
]
}
{
"_id" : ObjectId("59f71b700bec333e1707a8d4"),
"_class" : "com.wipro.domain.QuestionBank",
"subjectLists" : [
{
"subject" : "java",
"topicList" : [
{
"topic" : "threds",
"levelList" : [
{
"level" : "l3",
"complexityList" : [
{
"complexity" : "hard",
"questionTypeList" : [
{
"questionType" : "mcq",
"questionList" : [
{
"_id" : "3",
"question" : "3rd question",
"options" : [
{
"a" : "1",
"b" : "2",
"c" : "3",
"d" : "4"
}
],
"correctAnswer" : "b",
"marksAlloted" : "1"
}
]
}
]
}
]
}
]
}
]
}
]
}