【发布时间】:2020-09-30 21:25:01
【问题描述】:
我得到一些 [] 值用于我返回的一些键结果,但我想这样做,以便根本不会返回具有 [] 值的键。这需要在聚合管道中。
例如:
{
"_id": "5e42fb9b74753bd02c86ca2c",
"key_one": 'something',
"key_two": 'another thing',
"key_three": [],
"key_four": [],
"key_five": 'one more time
}
我想要返回的东西:
{
"_id": "5e42fb9b74753bd02c86ca2c",
"key_one": 'something',
"key_two": 'another thing',
"key_five": 'one more time
}
【问题讨论】:
标签: python mongodb aggregation-framework projection eve