In mongoDB, how to implement a complex query like what I described?

  mongodb, question

Problem background description:
An online examination system, when designing a database for storing examination questions,
If you use a collections to store basic questions, intermediate questions, high problems,
It is stored by setting the attribute type:easy or medium or hard of each instance, as shown in the following table:

"title": "Which of the following options does not belong to the javascript basic data type?"  ,
 "choose" : "A.boolen B.string C.function ",
 "true" : "C",
 "type" : "easy"

Now I want to randomly query 20 types: easy questions, how should I write the query statement? …
It is known that the random query function has been added to version 3.2.

 { $sample: { size: 20 } }

But in my test database, there are not only simple questions, but also middle-grade questions and high-grade problems.
How can I randomly query 20 questions from simple questions? …
There is another problem. Even if the 3.2 version adds the aggregate operation, mongoose does not seem to have it
To support this operation … how can we achieve the effect of the question if mongoose is used, t t

Resolved ..
Scheme 1. Define a self-increasing index when inserting test questions, and then use random* to collect the total number of data. Use this to find. find several times is to take several random numbers.
Scheme 2. the new aggregate method in mongoDB 3.2 achieves the effect through $match (filtering data) and $sample (taking random numbers).