const { Schema, model } = require('mongoose');

const collectionSchema = new Schema(
    {
        user_id: {
            type: Schema.Types.ObjectId,
            ref: 'User',
            required: true
        },
        cars: [
            {
                type: Schema.Types.ObjectId,
                ref: 'Cars',
                required: true
            }
        ],
    },
    { timestamps: true }
);

module.exports = model('Collection', collectionSchema, 'collections');