$or操作符

  The $or operator performs a logical OR operation on an array of two or more <expressions> and selects the documents that satisfy at least one of the <expressions>. The $or has the following syntax:

{ $or: [ { <expression1> }, { <expression2> }, ... , { <expressionN> } ] }

  Consider the following example:

db.inventory.find( { $or: [ { quantity: { $lt: 20 } }, { price: 10 } ] } )

  This query will select all documents in the inventory collection where either the quantity field value is less than 20 or the price field value equals 10.

  

随机推荐

  1. windows配置Scrapy爬虫框架

    一.环境 Windows10 64位 Python2.7.13 64位 下面的安装步骤最好配置代理,可能会遇到被墙的情况. 二.Python的安装 可以去参考这篇文章:http://blog.csdn ...

  2. c++ o2 优化

    有时候,写代码的时候要卡常 这时候就要用到o2优化 #pragma GCC optimize(2) 只要把这句话加在程序开头,就可以手动开o2优化了

  3. 在Indicator中添加动态Checkbox,无需绑定数据源,支持全选 - Ehlib学习(二)

    先做设置 DBGrideh属性设置: IndicatorOptions = [gioShowRowIndicatorEh, //小三角指示 gioShowRecNoEh, //数据源行号 gioSho ...

  4. STL标准库-容器-list

    技术在于交流.沟通,本文为博主原创文章转载请注明出处并保持作品的完整性. list 表示非连续的内存区域,并通过一对指向首尾元素的指针双向链接起来,从而允许向前和向后两个方向进行遍历.在list 的任 ...

  5. Winform工具栏ToolStrip和状态栏StatusStrip

    工具栏和状态栏的设置与前面的菜单基本相似 1.ToolStrip 从工具栏选项卡上拖一个放入窗体即可,位置也是通过其Dock设置的.先上一张图,红色部分就是工具栏,工具栏中可以放置如图下拉菜单中的Bu ...

  6. swift 触摸与手势

    class MyView: UIView { var lView:UIView! var time:NSTimer! override init(frame: CGRect) { super.init ...

  7. c++ istringstream的用法

    一.测试代码 istringstream 是将字符串变成字符串迭代器一样,将字符串流在依次拿出,比较好的是,它不会将空格作为流.这样就实现了字符串的空格切割. #include<iostream ...

  8. .net core microservices 架构之 分布式

    .net core microservices 架构之 分布式  一:简介   自动计算都是常驻内存的,没有人机交互.我们经常用到的就是console job和sql job了.sqljob有自己的宿 ...

  9. APScheduler - Advanced Python Scheduler

    简介 APScheduler:强大的任务调度工具,可以完成定时任务,周期任务等,它是跨平台的,用于取代Linux下的cron daemon或者Windows下的task scheduler. 内置三种 ...

  10. lerna基本试用

    安装 yarn global add lerna or npm install -g lerna 基本项目 初始化 git init platform cd platform lerna init 效 ...