0

我使用 mongoDB 方法 update 来修改名为annotations. 我用 Python 脚本编写的命令是:

db['annotations'].update({'_id': annotation['_id']}, {'$set': {'orthologs': orthologs}}, False)

orthologs必须修改该字段以包含UniProt由名为 的变量给出的新子字段orthologs

令人惊讶的是,创建了一个名为 的新集合annotations_keys。它只包含一个文件:{ "_id" : "UniProt", "value" : null }.

正常吗?如果不是,问题是什么?

4

1 回答 1

0

Yes Rafael, I'm sure.

The new created collection is really named 'annotationS'+'_keys' like the initial collection 'annotationS'. In addition, annotation['_id'] comes from a loop that finds in the db each document ('annotation') corresponding to the request:

annotation = db['annotations'].find_one({'class': 'CDS', 'locus_tag': annotated_molecule.name})
于 2015-01-08T10:11:42.440 回答