I have a db named student and I want to select the values between 30 and 60 from a column named u1. This is the query I used,but it shows some error
db.student.find($and:[{u1:{$gt:30}},{u1:{$lt:60}}])
You could also try this:
db.students.find({$and:[{u1:{$gt:30}},{u1:{$lt:60}}]})
The above statement will display the value of the field u1
which are in between 30 and 60