aaa
This commit is contained in:
@@ -139,7 +139,10 @@ const productSchema = new Schema({
|
|||||||
},
|
},
|
||||||
producer_name: {
|
producer_name: {
|
||||||
type: String,
|
type: String,
|
||||||
}
|
},
|
||||||
|
fornitore_name: {
|
||||||
|
type: String,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
var Product = module.exports = mongoose.model('Product', productSchema);
|
var Product = module.exports = mongoose.model('Product', productSchema);
|
||||||
@@ -289,9 +292,13 @@ module.exports.convertAfterImport = async function () {
|
|||||||
|
|
||||||
const campodarimuovere = 'producer_name';
|
const campodarimuovere = 'producer_name';
|
||||||
|
|
||||||
|
let ris = null;
|
||||||
|
|
||||||
if (recproducer) {
|
if (recproducer) {
|
||||||
await Product.findOneAndUpdate({ _id: prod._id }, { $set: { idProducer: recproducer._id } })
|
ris = await Product.findOneAndUpdate({ _id: prod._id }, { $set: { idProducer: recproducer._id } })
|
||||||
await Product.findOneAndUpdate({ _id: prod._id }, { $unset: { [campodarimuovere]: 1 } })
|
console.log('Ris', ris);
|
||||||
|
ris = await Product.findOneAndUpdate({ _id: prod._id }, { $unset: { [campodarimuovere]: 1 } })
|
||||||
|
console.log('Ris', ris);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user