简体   繁体   English

如何从 MongoDB 中的模式中获取值

[英]How can I get the value from a schema in MongoDB

I want to get the value from id I tryed this code我想从 id 中获取值我尝试了这段代码

c = dict["ids"]["id"]
print(c)


{'_id': ObjectId('6070965b28721d6e49c58c74'), 
 'gu_id': 'STRING', 
 'ids': [{'id': 'STRING'}, {'xp': INT}, {'msg': INT}, {'date': INT}]
}

But I always get a error但我总是得到一个错误

i write this query at robo3t.我在 robo3t 上写了这个查询。 Try it your computer.试试你的电脑。

尝试这个

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM