0
의 우리가 다음 맵 인덱스가 가정 해 봅시다 :RavenDb지도 인덱스 쿼리 혼란
public class CommentsIndex : AbstractIndexCreationTask<Post>
{
public class IndexResult
{
public string PostId {get;set;}
public DateTime CommentDateTime {get;set;}
}
public CommentsIndex()
{
Map = posts => from post in posts
from comment in post.Comment
select new { PostId = post.Id, CommentDateTime = comment.DateTime };
}
}
이 인덱스 쿼리의 결과는 포스트 문서의 집합이 될 것입니다. 하지만 CommentDateTime
까지 어떻게 쿼리 할 수 있습니까? 확실히 CommentDateTime
으로 작동하지 않습니다 쿼리에 이어 Post
문서의 일부가 아닌 : 나는 라이브 투사 또는 인덱스 쿼리 결과를 모양을 AsProjection
전화를 사용할 수 있습니다 알고
_documentSession.Query<Post, CommentsIndex>().Where(x => x.CommentDateTime < DateTime.UtcNow).ToList();
PS,하지만 난 더 자연스러운 해결책이 있어야한다 생각 그런 단순한 경우.
실제로 작동합니까? 내가 마지막 레이븐 빌드와 동일한 동작을 얻으려고 노력하고 그것을 할 수 없습니다. –
알렉산더, 그 이후로 많은 변화가있었습니다. 메일 링리스트에 완전한 설명을 게시하는 것이 좋습니다. –