惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
V
Visual Studio Blog
P
Privacy International News Feed
月光博客
月光博客
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
L
Lohrmann on Cybersecurity
N
News and Events Feed by Topic
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Apple Machine Learning Research
Apple Machine Learning Research
阮一峰的网络日志
阮一峰的网络日志
Webroot Blog
Webroot Blog
T
Threatpost
宝玉的分享
宝玉的分享
The Last Watchdog
The Last Watchdog
小众软件
小众软件
L
LINUX DO - 最新话题
C
Cisco Blogs
T
Troy Hunt's Blog
Schneier on Security
Schneier on Security
酷 壳 – CoolShell
酷 壳 – CoolShell
www.infosecurity-magazine.com
www.infosecurity-magazine.com
雷峰网
雷峰网
G
GRAHAM CLULEY
有赞技术团队
有赞技术团队
Know Your Adversary
Know Your Adversary
博客园 - 叶小钗
罗磊的独立博客
V
V2EX
博客园 - Franky
P
Proofpoint News Feed
SecWiki News
SecWiki News
腾讯CDC
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Jina AI
Jina AI
博客园 - 三生石上(FineUI控件)
S
Secure Thoughts
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Google DeepMind News
Google DeepMind News
Attack and Defense Labs
Attack and Defense Labs
人人都是产品经理
人人都是产品经理
The Cloudflare Blog
PCI Perspectives
PCI Perspectives
V2EX - 技术
V2EX - 技术
Google DeepMind News
Google DeepMind News
Last Week in AI
Last Week in AI
aimingoo的专栏
aimingoo的专栏
Cisco Talos Blog
Cisco Talos Blog
N
News and Events Feed by Topic
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
S
SegmentFault 最新的问题

博客园 - 大洋

在asp.net 项目的bin目录中使用子目录 MVC项目引用备注 OAuth相关备注 手动安装windows的磁盘清理工具 在CentOS上安装 MongoDB CentOS 笔记 MongoDb 出现配置服务不同步的处理 Exiting an iOS App with Xamarin Silverlight 离线安装包 批量修改WORD表格属性 搭建高可用mongodb集群(四)—— 分片 如何稳定地使用 Google 搜索https://encrypted.google.com/ widows 2008 同步时间命令 MySql 初始化权限脚本 [转] windows下Svn服务器之必须提交修改注释篇 给编译好的DLL增加签名 Anychart 破解备注 Javascript 日期时间格式正则 MongoDB C# 操作备忘
MongoDb 判断字段长度比较好的方法
大洋 · 2016-07-29 · via 博客园 - 大洋

查询某字段长度超过一定长度时的方法, MongoDB中可能不好处理,一般这样:

db.test.find({
    $where:"this.F_DAQDATA.legnth>600"
});

但用$where查询时性能可能不太好,在网上搜索之后,发现使用正则可能会更好,同时判断字段是否存在:

db.test.find({
    F_DAQDATA: {
        $type:2,        // 字段类型为2,表示有此字段,或者用: $exists: true
        $regex: /^.{600,}$/       // 长度大于600
    }     
});