我想创建聚合方法以获得该方程式的结果
e = ((s1-s)/(t1-t))
s1 = s
前记录的s = s
和
当前记录的t1 = t
前记录的t = t
我在MongoDB中有此记录
记录视图
{
"_id" : ObjectId("59d9e7b4ad433ce84a235e93"),
"s" : NumberInt(100),
"t" : NumberInt(10),
"z" : NumberInt(1)
}
{
"_id" : ObjectId("59d9e7d0ad433ce84a235e95"),
"s" : NumberInt(80),
"t" : NumberInt(19),
"y" : NumberInt(2)
}
{
"_id" : ObjectId("59d9e7d2ad433ce84a235e97"),
"s" : NumberInt(3),
"t" : NumberInt(30),
"y" : NumberInt(3)
}
{
"_id" : ObjectId("59d9e7d4ad433ce84a235e99"),
"s" : NumberInt(4),
"t" : NumberInt(42),
"y" : NumberInt(3)
}
{
"_id" : ObjectId("59d9e7d7ad433ce84a235e9b"),
"s" : NumberInt(3),
"t" : NumberInt(50),
"z" : NumberInt(5)
}