<p>需要帮助了解这里发生了什么,并提出了避免这种情况的建议!在</p>
<p>以下是我的片段:</p>
<pre><code> result = [list of dictionary objects(dictionary objects have 2 keys and 2 String values)]
copyResults = list(results);
## Here I try to insert each Dict into MongoDB (Using PyMongo)
for item in copyResults:
dbcollection.save(item) # This is all saving fine in MongoDB.
</code></pre>
<p>但是当我再次遍历原始结果列表时,它会显示添加了新字段的dictionary对象
自动从MongoDB获取ObjectId!在</p>
<p>在后面的代码中,我需要将原始结果列表转换为json,但是这个ObjectId导致问题。没有这是为什么会被添加到原始列表中的线索。在</p>
<p>我已经尝试过复制或创建新列表等。它仍然在原始列表中添加ObjectId。在</p>
<p>请建议!在</p>