$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. Haproxy的负载均衡和高可用配置

    一.Haproxy的理解    Haproxy是一个使用c语言编写的自由开发源代码软件,它提供高可用性.负载均衡.以及基于http和tcp的应用程序代理.    Haproxy特别使用于那些负载特别大 ...

  2. Android sdk 更新后编译不过,【Could not find com.android.sdklib.build.ApkBuilderMain】

    最近更新了Android sdk,发现编译不过了 解决方案: 进入 sdk/tool/lib/ 目录下,看看有没有 sdklib.jar 这个文件,如果没有看看有没有sdklib-25.*.*.jar ...

  3. Nginx下载和安装与启动

    nginx是什么 nginx是一个开源的,支持高性能,高并发的www服务和代理服务软件.它是一个俄罗斯人lgor sysoev开发的,作者将源代码开源出来供全球使用. nginx比它大哥apache性 ...

  4. opencv之访问图像像素

    访问像素的三种方法 ①指针访问:最快 ②迭代器iterator:较慢,非常安全,指针访问可能出现越界问题 ③动态地址计算:更慢,通过at()实现.适用于访问具体某个第i行,j列的像素,而不适用遍历像素 ...

  5. 使用ajax提交form表单,包括ajax文件上传 转http://www.cnblogs.com/zhuxiaojie/p/4783939.html

    使用ajax提交form表单,包括ajax文件上传 前言 使用ajax请求数据,很多人都会,比如说: $.post(path,{data:data},function(data){ ... },&qu ...

  6. USB学习笔记-总结

    1. # ls /sys/bus/usb/devices/解析:1-0:1.0 1-1 1-1:1.0 2-0:1.0 2-1 2-1:1.0 2-2 2-2.1 2-2:1.0 2-2.1:1.0 ...

  7. python random模块(随机数)详解

    使用前要先导入random模块 import random random.randomrandom.random()用于生成一个0到1的随机符点数: 0 <= n < 1.0 random ...

  8. CentOS6.6 VSFTP服务器安装设置

    1:安装vsftpd    yum install vsftpd 2:关闭防火墙 service iptables stop 3:允许21端口通行 vi /etc/sysconfig/iptables ...

  9. Phonegap 原生控件(Android)与html混合

    1. 用命令创建cordova项目 cordova coreate hello com.example.hello hello 2.打开MainActivity 在onCreate方法中加入 setC ...

  10. android adb端口被占用解决方法

    1.输入adb devices命令 C:\Users\Nick>adb devices List of devices attached adb server version (31) does ...