- catalogo avanti, parte 1
This commit is contained in:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user