Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
好的,如果标题具有误导性,我深表歉意,我找不到合适的措辞。
所以我有一个集合,我想从中计算所有条目UserId的StatusId值。
UserId
StatusId
我正在寻找与下面的 SQL 查询类似/相同的东西。 SELECT COUNT(*) FROM Warns WHERE UserId = uId AND StatusId = sId;
SELECT COUNT(*) FROM Warns WHERE UserId = uId AND StatusId = sId;
LiteDB 是否存在类似的东西?
您可以Count直接使用该方法:
Count
var count = collection.Count(Query.EQ("Field", "Value"));
或者使用标准的收集方法:
var count = query.Run(...).LongCount();