mongo查询specialOperations不为空值与specialEquipment不为空值
可以使用如下的MongoDB查询语句来查询specialOperations不为空值且specialEquipment不为空值的文档:
db.collection.find({
specialOperations: { $exists: true, $ne: null },
specialEquipment: { $exists: true, $ne: null }
})
这个查询语句使用了MongoDB的$exists和$ne操作符。$exists操作符用于匹配文档中是否存在某个字段,$ne操作符用于匹配字段不等于指定值。在这个查询中,我们使用$exists和$ne操作符来匹配specialOperations和specialEquipment字段都存在且不为空值的文档。
原文地址: https://www.cveoy.top/t/topic/fJT5 著作权归作者所有。请勿转载和采集!