- catalogo avanti, parte 1

This commit is contained in:
Surya Paolo
2024-05-04 14:49:02 +02:00
parent e1f2e799d6
commit 07973fbf0a
14 changed files with 639 additions and 171 deletions

View File

@@ -88,6 +88,9 @@ const productInfoSchema = new Schema({
img3: {
type: String,
},
img4: {
type: String,
},
ingredienti: {
type: String,
},
@@ -97,18 +100,20 @@ const productInfoSchema = new Schema({
note: {
type: String,
},
author: {
type: String,
},
idAuthors: [{ type: Schema.Types.ObjectId, ref: 'Author' }],
idPublisher: { type: Schema.Types.ObjectId, ref: 'Publisher' },
collezione: {
type: String,
},
publisher: { //editore
type: String,
date_publishing: {
type: Date,
},
numpages: {
type: Number,
},
productType: {
type: Number,
},
});
@@ -163,6 +168,14 @@ module.exports.findAllIdApp = async function (idapp, code, id) {
as: 'catprods'
}
},
{
$lookup: {
from: 'authors',
localField: 'idAuthors',
foreignField: '_id',
as: 'authors'
}
},
{
$lookup: {
from: 'subcatprods',