RavenDB Join Query

无人久伴 提交于 2019-12-24 02:08:43

问题


Given the following three documents in RavenDB

public class Auction {
    public string Id;
    public DateTimeOffset? StartingOn;
    public DateTimeOffset? EndingOn;
}

public class Car {
    public string Id;
    public string Model;
    public string Make;
    public IEnumerable<string> EnlistedAuctions;
}

public  class User {
    public string Id;
    public string Name;
    public IEnumerable<string> AvailableAuctions;
}

usecase: I want to retreive all Cars for a given User. i.e. join Car to User on their matching auctions.

curveball: the user can generally have a few hundred auctions easily, so I don't want to pull that list in memory and query the car in auction ids for a list of say 300 values.

I know that joins can be achieved with the TransformResults Index, but can't get my head around it with how the Map and the TransformResults connect together (i.e. if TransformResults is the answer).

来源:https://stackoverflow.com/questions/7948364/ravendb-join-query

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!