MST
星途 面试题库
面试题:MongoDB中复杂条件查询文档操作
假设有一个MongoDB集合名为`students`,文档结构如下:{name: '张三', age: 20, scores: {math: 85, english: 90}, class: '一班'}。请写出查询语句,找出年龄大于18岁且数学成绩大于80分的学生文档。
36.2万 热度
难度
数据库
MongoDB
知识考点
面试题答案
一键面试
db.students.find({ age: { $gt: 18 }, 'scores.math': { $gt: 80 } });