- catalogo avanti, parte 1
This commit is contained in:
@@ -33,6 +33,9 @@ const productSchema = new Schema({
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
isbn: {
|
||||
type: String,
|
||||
},
|
||||
idProductInfo: { type: Schema.Types.ObjectId, ref: 'ProductInfo' },
|
||||
idProducer: { type: Schema.Types.ObjectId, ref: 'Producer' },
|
||||
idStorehouses: [
|
||||
@@ -146,6 +149,9 @@ const productSchema = new Schema({
|
||||
note: {
|
||||
type: String,
|
||||
},
|
||||
versione: {
|
||||
type: Number,
|
||||
},
|
||||
producer_name: {
|
||||
type: String,
|
||||
},
|
||||
@@ -346,6 +352,14 @@ module.exports.findAllIdApp = async function (idapp, code, id, all) {
|
||||
preserveNullAndEmptyArrays: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
$lookup: {
|
||||
from: 'authors',
|
||||
localField: 'productInfo.idAuthors',
|
||||
foreignField: '_id',
|
||||
as: 'productInfo.authors'
|
||||
}
|
||||
},
|
||||
{
|
||||
$lookup: {
|
||||
from: 'catprods',
|
||||
@@ -836,8 +850,8 @@ module.exports.singlerecconvert_AfterImport_AndSave = async function (idapp, pro
|
||||
|
||||
ris = await Product.updateOne({ _id: ObjectID(prod._id) }, { $unset: objDelete })
|
||||
|
||||
if (ris) {
|
||||
console.log('ris', ris);
|
||||
if (ris && ris.nModified > 0) {
|
||||
console.log('Modificato: ', objtoset.name);
|
||||
}
|
||||
|
||||
// const campodarimuovere = 'producer_name';
|
||||
|
||||
Reference in New Issue
Block a user