$or操作符
【$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.
随机推荐
- 关于将vector以及string传递给较老的api的问题
现在可能STL使用的越来越多,但是一些较老的api并不支持例如vector这样的兑现,但是可以使用一些技巧来使其适应于这些函数. 例如对于使用到int*型的函数来说,传入一个 &vector[ ...
- resin3.1处理utf-8格式的jsp时存在的问题
解决建议:http://cnxiaowei.iteye.com/blog/262766 /dqz/eh_sdxm/reporter/reporter_show_reportdraw_river.jsp ...
- Winform工具栏ToolStrip和状态栏StatusStrip
工具栏和状态栏的设置与前面的菜单基本相似 1.ToolStrip 从工具栏选项卡上拖一个放入窗体即可,位置也是通过其Dock设置的.先上一张图,红色部分就是工具栏,工具栏中可以放置如图下拉菜单中的Bu ...
- js实现trim()方法
在面向对象编程里面去除字符串左右空格是很容易的事,可以使用trim().ltrim() 或 rtrim(),在jquery里面使用$.trim()也可以轻松的实现.但是在js中却没有这个方法.下面的实 ...
- 递归遍历嵌套结构(多层List)中的元素 ------Python
读Python基础教程(第二版)后看到了这么一个东西,就是利用递归遍历嵌套结构中的元素. 上代码: #encoding:UTF-8 def flatten(nested): try: #不要迭代类似字 ...
- Linux之screen命令详解
一.nohup 工作中经常会遇到这样的需求,通过SecureCRT或其它工具远程到服务器执行某个任务,而这个任务耗时又比较长,你又不得不等待它执行完毕,但是如果此间如果关掉窗口或断开连接又会导致任务被 ...
- javascript window.onload 加载多个函数的方法
用法如下: function func(){alert("this is window onload event!");return;} window.onload=func; 或 ...
- 51Nod 1088:最长回文子串(暴力)
1088 最长回文子串 基准时间限制:1 秒 空间限制:131072 KB 分值: 0 难度:基础题 收藏 关注 回文串是指aba.abba.cccbccc.aaaa这种左右对称的字符串. 输入 ...
- pandas dataframe 读取 xlsx 文件
refer to: https://medium.com/@kasiarachuta/reading-and-writingexcel-files-in-python-pandas-8f0da449c ...
- hydra nodejs 微服务框架简单试用
hydra 是一个以来redis 的nodejs 微服务框架 安装 需要redis,使用docker 进行运行 redis docker run -d -p 6379:6379 redis 安装yo ...