mongodb更新文档数组的特定元素

时间:2018-07-29 10:00:41

标签: mongodb

根据文档Update Specific Elements of an Array of Documents

中的示例,信息更新不起作用
from  itertools import product

L = [[[x[0]], sorted(x[1]), sorted(x[2])] for x in nested_list]
df1 = pd.DataFrame([j for i in L for j in product(*i)], columns=['Cat','Column','Value'])
print (df1.head(20))

   Cat Column  Value
0   R1      a   20.0
1   R1      a   40.0
2   R1      a   50.0
3   R1      a   60.0
4   R1      a  750.0
5   R1      b   20.0
6   R1      b   40.0
7   R1      b   50.0
8   R1      b   60.0
9   R1      b  750.0
10  R1      c   20.0
11  R1      c   40.0
12  R1      c   50.0
13  R1      c   60.0
14  R1      c  750.0
15  R2      x   35.0
16  R2      x   37.5
17  R2      x  165.0
18  R2      y   35.0
19  R2      y   37.5

错误:在路径“ grades。$ [element]”中找不到标识符“ element”的数组过滤器。

Query && Error

Collection

文档宣布从3.6版开始支持Mongo。我正在使用3.6版。

告诉我为什么会出错?

0 个答案:

没有答案
相关问题