- ordinamento per Data

This commit is contained in:
Surya Paolo
2024-06-21 16:11:03 +02:00
parent c3cc344b9f
commit 1c7b89a55b
7 changed files with 51 additions and 48 deletions

View File

@@ -49,9 +49,9 @@ const catalogo = new Schema(
//++AddCATALOGO_FIELDS
productTypes: [{ type: Number }],
excludeproductTypes: [{ type: Number }],
Editore: [{ type: String }],
// formato: [{ type: String, default: '' }],
// categoria: [{ type: String, default: '' }],
// Editore: [{ type: String, default: '' }],
}
);

View File

@@ -61,9 +61,9 @@ const productSchema = new Schema({
active: {
type: Boolean,
},
arrversioni: [{
versione: {
type: Number,
}],
},
status: { //publish
type: String,
},
@@ -500,6 +500,20 @@ module.exports.findAllIdApp = async function (idapp, code, id, all) {
as: 'productInfo.authors'
}
},
{
$lookup: {
from: 'publishers',
localField: 'productInfo.idPublisher',
foreignField: '_id',
as: 'productInfo.publisher'
}
},
{
$unwind: {
path: '$productInfo.publisher',
preserveNullAndEmptyArrays: true,
},
},
{
$lookup: {
from: 'catprods',

View File

@@ -117,6 +117,9 @@ const productInfoSchema = new Schema({
date_publishing: {
type: Date,
},
date_publishing_ts: {
type: Number,
},
productTypes: [{
type: Number,
}],