$in 操作符

  The $in operator selects the documents where the value of a field equals any value in the specified array.

  $in 选择包含指定值之一的 doc。

  

  If the field holds an array, then the $in operator selects the documents whose field holds an array that contains at least one element that matches a value in the specified array

Use the $in Operator with a Regular Expression

The $in operator can specify matching values using regular expressions of the form /pattern/. Youcannot use $regex operator expressions inside an $in.

Consider the following example:

db.inventory.find( { tags: { $in: [ /^be/, /^st/ ] } } )

This query selects all documents in the inventory collection where the tags field holds an array that contains at least one element that starts with either be or st.

参考:https://docs.mongodb.org/manual/reference/operator/query/in/#op._S_in

最新文章

  1. Lua 协程coroutine
  2. Erlang及Rabbitmq安装
  3. highcharts 统计的样式
  4. android -- 蓝牙 bluetooth (五)接电话与听音乐
  5. delphi 插入表格HTML代码
  6. Build Error 6041: Internal build error
  7. jquery的使用 超级快速入门 熟练使用
  8. 【shell编程基础0】bash shell编程的基本配置
  9. robotframework文本类型的下拉框
  10. 在MySQL和PostgreSQL之外,为什么阿里要研发HybridDB数据库?
  11. shell编程练习(二): 笔试11-20
  12. sys.exit(main(sys.argv[1:]))
  13. JSJ—类与对象
  14. AMD-requireJS
  15. java、python与留下迷点的php hash collision
  16. Linux知识扩展一:执行前为什么加./
  17. UVALive - 6440(模拟)
  18. NodeJS收发GET和POST请求
  19. 用Collections升降排序
  20. Android 修改系统默认density

热门文章

  1. DIY远程移动图像监测(tiny6410+USB摄像头+motion+yeelink+curl)
  2. php http build query
  3. Hadoop/Spark入门学习笔记(完结)
  4. Java第三次作业--面向对象基础(封装)
  5. I.MX6 Manufacturing Tool V2 (MFGTool2) ucl2.xml hacking
  6. hdu 3613 Best Reward
  7. ASP.NET MVC3默认提供了11种ActionResult的实现
  8. fusionjs 学习一 基本试用
  9. flash exe to flv swf
  10. 什么是HBase(五) HBase的运维工具