【问题标题】:Spring Data - Mongo DB - @TextIndexed over @DBRefSpring Data - Mongo DB - @TextIndexed over @DBRef
【发布时间】:2017-07-18 00:56:01
【问题描述】:

是否可以通过@DBRef 在字符串字段中进行搜索。 我有这个@Document:

public class DocumentFileVersion {

    @TextIndexed
    @DBRef
    private OtherObject otherObject

我将在 otherObject 的字符串字段中进行搜索。有没有可能这样做?

【问题讨论】:

    标签: mongodb spring-data dbref


    【解决方案1】:

    DBRef 设计为仅供id 参考查询。

    所以这是不可能的。您应该重新考虑您的架构结构。

    【讨论】:

      猜你喜欢
      • 2017-10-30
      • 2015-02-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-09-24
      • 1970-01-01
      • 2020-04-24
      相关资源
      最近更新 更多