I am using nodeJs with mongoDB. I have a user collection where I am saving 2types of users (student/teacher). So now I want to get all users which type is student
Below query will find all the user with the type "student". replace "student" with "teacher" and you will get the list of all teacher's.
users.find({ userType: 'student' });