Mongo 查询以从嵌套文档中获取字段

问题描述

我有一个这样的 mongo 集合:

Collection :rResponse
{
    "_id" : ("59c8248 "),"correlationId" : ("b92b3 "),"rtResponse" : {
        "rTiming" : {
            "servicetime" : "2020-04-17 11:50:42.1053555 (GMT-04:00)"
}

我试图使用查找查询来访问服务时间。

db.rResponsee.rtResponse.rTiming.find( { servicetime: '2020-05-01 08:25:58.4083775 (GMT-04:00)' } );

但它返回 0 行。任何帮助/建议将不胜感激。

解决方法

您的语法已关闭,该字段的整个路径需要出现在对 abstract class Foo<T,C extends Iterable<T>> {} class FooList<T> extends Foo<T,List<T>> {} 的调用中:

find(...)