【发布时间】:2019-09-23 07:09:43
【问题描述】:
此问题与 MongoDB Compass Community Version 1.17.0 有关。
代码{ location: /IL$|US$/i }(带有正则表达式选项)可与文档过滤器工具配合使用,但在聚合$match 管道阶段应用程序显示Expected "[" or AggregationStage but "{" found.
没有正则表达式选项的代码,即{ location: /IL$|US$/ } 在过滤器和聚合工具中都有效。
如何在 MongoDB Compass 的 $match 管道阶段使用正则表达式选项?
【问题讨论】: