如何查询RavenDB 4以查找包含与输入列表中的项匹配的文档列表的文档?
以下用于在RavenDB 3中工作,但在4中不支持
List<string> categories = new List<string>() { "C#", "java" });
var jobs = _session.Query<Job, Job_Index>.Where(j => j.Categories.Any(c => c.In(categories)));
答案 0 :(得分:1)
我相信这样的事情应该有效:
using Raven.Client.Documents.Linq; // needed for .ContainsAny extension method
var categories = new List<string>() { "C#", "java" });
var jobs = _session.Query<Job, Job_Index>
.Where(j => j.Categories.ContainsAny(categories));