博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
【MongoDB】The Regex Expression query of MongoDB
阅读量:4169 次
发布时间:2019-05-26

本文共 746 字,大约阅读时间需要 2 分钟。

In the past two blogs, the topic mainly focus on the high query operation of mongodb.In this blog, we simply study the regex expression in the mongdb.  MongoDB also support the regex query. For example

The expression is also able to combination with other expression.

Notes: /^a/; /^a.*/; /^a.*$/ have the same result, however the later two have less efficiency than the first one. Because the later will scan all the things, but the first only scan the first character. 

The item:

-i : ignore the upper or low case 

-m: the begin '^' and end'$' do work on every new line;

-x: ignore the blank character

-s:  since 1.9 version, adding it could make '.' reprent all the character. 

for example:

/a.*b/ does not matches "apple\nbanana" but /a.*b/s does. 

你可能感兴趣的文章
嵌入式100题(60):系统调用的作用
查看>>
C语言基本概念归纳
查看>>
初识单片机
查看>>
在单片机上点亮LED
查看>>
初学定时器
查看>>
数码管
查看>>
单片机数码管消隐及中断
查看>>
C#串口调试助手代码
查看>>
学习DS1820随记
查看>>
初学C#之windowes窗口应用文件
查看>>
linux常用命令
查看>>
Linux之vim(一)vim简介
查看>>
进程间通信的方式简单解析————管道
查看>>
git学习笔录
查看>>
Activity类中7个与活动生命周期回调有关的方法
查看>>
jwt与token+redis,哪种方案更好用?
查看>>
Comparator接口
查看>>
在二叉树中找到一个节点的后继节点
查看>>
寻找第K大
查看>>
String.trim
查看>>