Thanks Kushagra. I’ve created a minimal version of the site for testing. Here’s part of my VSC screen showing the code snippet and Terminal showing timings of 5 sequential loads of the home page.
I’m running node 18.18.0 and mongoose 8.0.2 on a Macbook M1 Pro with 16GB of memory running Sonoma 14.1.1.
Not sure what you mean by sample documents but here’s a screenshot from Atlas of the colleciton:
The full schema is:
const listingSchema = new mongoose.Schema({
shortTitle: String,
etsyTitle: String,
description: String,
etsyId: Number,
state: String,
etsyShopSectionId: Number,
categories: [{type: Schema.Types.ObjectId, ref: “Category”}],
collections: [{type: Schema.Types.ObjectId, ref: “Collection”}],
imageUrls: [{rank: Number, url: String, thumbnail: String}],
videoUrls: [{height: Number, width: Number, url: String}],
sizes: [{size: String, imageUrl: String}],
colors: [{color: String, imageUrl: String}],
styles: [{category: String, styles: [{value: String, imageUrl: String}]}],
price: Number,
etsyRank: Number,
etsyUrl: String,
customizable: Boolean,
personalizable: Boolean,
personalizationRequired: Boolean,
personalizationCharCount: Number,
personalizationInstructions: String,
tags: [String],
materials: [String],
processingMin: Number,
processingMax: Number,
etsyPartners: [Number],
partners: [{type: Schema.Types.ObjectId, ref: “Partner”}],
originIso: String,
originPostalCode: String,
shippingDestinations: [
{region: String,
iso: String,
priceBreaks: [
{breakQty: Number,
amount: Number,
currency: String
}
],
minDays: Number,
maxDays: Number
}
],
}, opts);