0
考慮以下entitis(EventReactions,事件日誌):春數據MongoDB的查詢
public class EventReaction extends Entity {
@Id
private String id;
private EventLog eventLog;
....
//getters and setters
}
和
public class EventLog extends Entity {
@Id
private String id;
....
//getters and setters
}
我希望下面的接口
public interface EventReactionRepository extends MongoRepository<T , String>{
Optional<EventReaction> findByEventLog_Id(String id)
}
返回它們的eventLog ID爲id
的eventReactions。但是,它已經存在於mogoDB中,我的查詢什麼也沒有返回!我的查詢是否正確?