如何在MongoDB中使用ContainsAll

时间:2012-05-08 02:07:59

标签: .net linq mongodb

帮助我理解为什么声明:

var query =
collection.AsQueryable<C>()
.Where(c => c.A.ContainsAll(new[] { 1, 2, 3 }));

导致此错误:

int does not contain a definition for ContainsAll and the best extension method overload MongoDB.Driver.Linq.LinqToMongo.ContainsAll<TSource>(System.Collections.Generic.IEnumerable<TSource>)

1 个答案:

答案 0 :(得分:0)

.Where(x => Query.All("Field", array).Inject())