返回MongoDB中属性的值

时间:2018-05-29 20:02:46

标签: python mongodb pymongo

我在MongoDB中有一个名为(Emotion)的集合,它有13个文档,其中一个属性是(maxEmotion)

我正在使用Python,我想返回该属性的所有值,所以最后我将得到13个结果。

我试过了:

emotions = db.Emotion.distinct("maxEmotion")

但我没有得到正确的结果。

这是该系列的图片: enter image description here

谢谢。

0 个答案:

没有答案