back soft

مطالب مرتبط با «between query in mongodb» در back soft | نویسنده: استخدام کار

between query on mongodb

Vote count: 0 i have this collection { "_id" : ObjectId("57b8277cd48b97d6e38d9eb2"), "student_id" : "326598", "sem" : "sem1", "marks" : [ { "title" : "english", "from" : 2, "to" : 15 }, { "title" : "maths", "from" : 5, "to" : 18 }, { "title" : "science", "from" : 10, "to" : 20 } ] } { "_id" : ObjectId("52873b7e4038253faa4bbc10"), "student_id" : "124578", "sem" : "sem1", "marks" : [ { "title" : "english", "from" : 1, "to" : 20 }, { "title" : "maths", "from" : 6, "to" : 16 }, { "title" : "science", "from" : 12, "to" : 20 } ] } and write this query : var x= 7; db.getCollection('numbers').aggregate([ {$unwind : "$marks"}, {$match : {$and :[{"marks.from": { $gte :2 } },{"marks.to": { $...

ادامه مطلب