|
|
@@ -114,7 +114,16 @@ module.exports={
|
|
|
let bulks = [];
|
|
|
for (let data of datas) {
|
|
|
if (data.updateType === 'update') {
|
|
|
- bulks.push({updateOne: {filter: {ID: data.updateData.ID}, update: {NextSiblingID: data.updateData.NextSiblingID}}});
|
|
|
+ let updateItem;
|
|
|
+ if (data.updateData.NextSiblingID !== undefined) {
|
|
|
+ updateItem = { NextSiblingID: data.updateData.NextSiblingID }
|
|
|
+ }
|
|
|
+ if (data.updateData.name !== undefined) {
|
|
|
+ updateItem = { name: data.updateData.name }
|
|
|
+ }
|
|
|
+ if (updateItem) {
|
|
|
+ bulks.push({updateOne: {filter: {ID: data.updateData.ID}, update: updateItem}});
|
|
|
+ }
|
|
|
} else {
|
|
|
bulks.push({insertOne: {document: data.updateData}});
|
|
|
}
|