Quellcode durchsuchen

设置模板时_id冲突bug

zhongzewei vor 7 Jahren
Ursprung
Commit
d42d8c05ae

+ 1 - 0
modules/ration_repository/models/ration_section_tree.js

@@ -23,6 +23,7 @@ rationChapterTreeDAO.prototype.initSectionTemplate = async function (rationLibId
     let bulks = [];
     let stdRationSection = await rationChapterTreeModel.find({rationRepId: rationLibId});
     for (let data of stdRationSection) {
+        delete data._doc._id;
         data._doc.compilationId = compilationId;
         bulks.push({insertOne: {document: data}});
     }

+ 1 - 0
modules/std_glj_lib/models/gljMapModel.js

@@ -230,6 +230,7 @@ class GljMapDao extends OprDao{
         let bulks = [];
         let stdGljClass = await gljClassModel.find({repositoryId: gljLibId});
         for (let data of stdGljClass) {
+            delete data._doc._id;
             data._doc.compilationId = compilationId;
             bulks.push({insertOne: {document: data}});
         }