admin管理员组文章数量:1427910
My pipeline intermediate result looks like this:
[
{
"claim": [
{
"_id": "1-8101-2023-0445722",
"data_accadimento": {"$date": "2023-11-30T00:00:00.000Z"},
"index": 180,
"rainValue": 26.290000000000006,
"hailValue": 0,
"inundationValue": -1.7223792589410434,
"windValue": 5.940000057220459,
"lightningValue": 0
}
]
},
{
"claim": [
{
"_id": "1-8101-2023-0445722",
...
]
I am trying to access rainValue
inside a $project
stage by doing:
{
$project: {
claimRainValue: "$claim.0.rainValue"
}
},
However the result is an empty array.
Why? The number of elements inside the claim
array is one.
本文标签: aggregation frameworkUnable to access first element of array in mongodb pipelineStack Overflow
版权声明:本文标题:aggregation framework - Unable to access first element of array in mongodb pipeline - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745516225a2661555.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论