【发布时间】:2018-02-15 16:33:06
【问题描述】:
我正在尝试为我的收藏获取最少的数据,以下查询对我有用。现在我正在尝试为这个最小值添加时间戳我该怎么做?
public class Metric
{
[BsonRepresentation(BsonType.ObjectId)]
public string Id { get; set; }
public string TagName{ get; set; }
public DateTime TimeStamp { get; set; }
public decimal? Val { get; set; }
}
var x2 = aggregate.Group(
x => x.TagName,
g => new
{
MinVal = g.Select(
x => x.Val
).Min()
}
)).ToList();
【问题讨论】:
标签: c# mongodb aggregation-framework