从mongo BD中的facet命令获取信息
我正在尝试从管道中提取名称列表,其中我得到以下内容:
command_5 = {"$facet": {
"list_of_station_names": my_query_1}}
并得到结果:
list_of_station_names : [{'desc': 'Sip Ave'}, {'desc': 'Vesey Pl &; River Terrace'}, {'desc': 'Murray St &; West St'},{'desc': 'E 81 St &; York Ave'}]
但我需要列表中的结果不带属性名称“desc”,如下所示:
list_of_station_names : ['Sip Ave', 'Vesey Pl &; River Terrace','Murray St &; West St','E 81 St &; York Ave']
I'm trying to extract a list of names from a pipeline, where I get the following:
command_5 = {"$facet": {
"list_of_station_names": my_query_1}}
And get as result:
list_of_station_names : [{'desc': 'Sip Ave'}, {'desc': 'Vesey Pl &; River Terrace'}, {'desc': 'Murray St &; West St'},{'desc': 'E 81 St &; York Ave'}]
but I need the results in a list without the attribute name "desc", like this:
list_of_station_names : ['Sip Ave', 'Vesey Pl &; River Terrace','Murray St &; West St','E 81 St &; York Ave']
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您只能在刻面之后映射它。
mongoplayground
You can only map it after facet.
mongoplayground