Skip to content

How to can we remove auto generated fields from the UI #108

@Shubham-Kumar-2000

Description

@Shubham-Kumar-2000

Suppose there is following collection :

const mongoose = require('mongoose');
const Schema = mongoose.Schema;

const imageSchema = new Schema(
    {
        key: { type: String },
        filePath: { type: String, default: '' }
    },
    { timestamps: true }
);
imageSchema.pre('save', function (next) {
    const data = this;
    data.filePath = 'abc.com' + data.key;
    return next();
});

const Image = mongoose.model('Images', imageSchema);
module.exports = Image;

As you can see her fields like filePath, createdAt and updatedAt are auto generated field and shouldn't come in UI

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions