为什么我的查询returns所有字段?

Why my query returns all fields?

我需要找到调用 dados 的特定字段,这非常有效,但 return 对我来说是所有字段。
我怎样才能 return 只是 dados 字段?

@Query("{\"dados\": {$ne: null}}, {\"dados\": 1}")
List<Contato> findOnlyDados();

实体(没有 getter 和 setter)

     @Document
     public class Contato {

        @Id
        private String id;
        String nome;
        List<Info> dados;
        @DBRef
        Agencia agencia;

    static class Info {
        String campo;
        String valor;
    }

   }

当我发出 GET 请求时

{
  "_links": {
    "self": {
      "href": "http://localhost:8181/api/contatos/search/findOnlyDados"
    }
  },
  "_embedded": {
    "contatos": [
      {
        "nome": "Contato one",
        "dados": [
          {
            "campo": "teste um",
            "valor": "fmdsf"
          },
          {
            "campo": "dois",
            "valor": "bdfbfd"
          }
        ],
        "_links": {
          "self": {
            "href": "http://localhost:8181/api/contatos/55b66de7ccf21a7a1cfcd403"
          },
          "agencia": {
            "href": "http://localhost:8181/api/contatos/55b66de7ccf21a7a1cfcd403/agencia"
          }
        }
      },
      {
        "nome": "Contato bgf",
        "dados": [
          {
            "campo": "teste jghj",
            "valor": "ytrf"
          },
          {
            "campo": "jhjhn",
            "valor": "bdfbfd"
          }
        ],
        "_links": {
          "self": {
            "href": "http://localhost:8181/api/contatos/55b66dfeccf21a7a1cfcd404"
          },
          "agencia": {
            "href": "http://localhost:8181/api/contatos/55b66dfeccf21a7a1cfcd404/agencia"
          }
        }
      }
    ]
  }
}

要限制查询返回的字段,请使用 @Query 注释的 fields 属性。