NOSQL ecommerce db design

I am building an ecommerce app using MongoDB as the choice of database. So far, I have developed this schema for products and variations. However, I have some doubts about its scalability and implementation of the shopping cart functionality. Additionally, I am considering whether it would be better to separate the variations into another schema. I have made several modifications to the schema, and I am currently feeling confused. I would greatly appreciate any help or guidance in improving this schema.

It all started when I thought about the possibility of renaming a term, which led me to separate it into its own schema to ensure that the same _id is shared and any updates to the term are reflected across all instances. However, it seems there may be more to consider. Please assist me in refining this schema and addressing any potential issues. Thank you.

const productSchema = new mongoose.Schema({

    product_name: {
        type: String,
        required: true,
        index: true
    },
    slug: {
        type: String,
        required: true
    },
    product_description: {
        type: String,
        required: true
    },
    category_id: {
        type: mongoose.Schema.Types.ObjectId,
        ref: 'productscategories',
        required: true,
    },
    seller_id: {
        type: String,
    },
    product_type: {
        type: String,
        required: true
    },
    product_gallery: {
        type: Array,
        required: true
    },
    original_price: {
        type: Number,
    },
    sale_price: {
        type: Number,
        required: true
    },
    variations: [{
        attribute: {
            type: mongoose.Schema.Types.ObjectId,
            ref: 'productsterms',
            required: true
        },
        terms: [
            {
                term: {
                    type: mongoose.Schema.Types.ObjectId,
                    ref: 'productsattributes',
                    required: true
                },
                sku: {
                    type: String,
                },
            }
        ]
    }],
    sku: {
        type: String,
    },
    quantity: {
        type: Number,
    },
}, { timestamps: true })

const productsAttributesSchema = new mongoose.Schema({
    attribute_name: {
        type: String,
        required: true,
        unique: true
    },
    slug: {
        type: String,
        unique: true,
    }
}, { timestamps: true } )

const productsTermsSchema = new Schema({
    term_name: {
        type: String,
        required: true,
        unique: true
    },
    slug: {
        type: String,
        unique: true
    },
    price: {
        type: Number,
        required: false,
    },
    attribute_id: {
        type: Schema.Types.ObjectId,
        required: true
    },
    image: {
        type: String,
        required: false,
    },
    is_default: {
        type: Boolean,
        default: false
    },
})

From my own experience, I can say that designing the schema can be challenging, especially when it involves scalability and incorporating shopping cart features.

I’m not an active website developer, so I can’t claim proficiency in specific frameworks and technologies. However, web developers usually gain expertise based on their background, experience, and training. Common frameworks include front-end and back-end frameworks, along with various database management systems.