Create Custom validation in Mongoose

const mongoose = require('mongoose');
mongoose.connect("mongodb://localhost:27017/newDB",{useNewUrlParser: true})
.then(()=>{
    console.log("connction successful...")
})
.catch((err)=>console.log(err));

const playlistSchema = new mongoose.Schema ({
    // define schema
    name:{
        type : String,
        required : true
    },
    sirname : String,
    email : String,
    role : String,
    active : Boolean,
    date : {
        type: Date,
        default : Date.now
    },
    marks :{
        type : Number,
        validate(value){
            if(value < 0){
                throw new Error('marks count should not be negative');
            }
        }
    }
})

// collection creation
const PlayList = new mongoose.model("PlayList",playlistSchema)

// create document or insert
const createDocument = async ()=>{
    try{
        const FirstStudent = new PlayList(
            {
              name:"Shreyash123",
              sirname :  "KOlhe123",
              email : "shreyashkolheqewr2513001@gmail.com",
              role : "front-endqewr",
              active : true,
              marks : -234
            })
           
            const result = await PlayList.insertMany([FirstStudent]);
            console.log("Data inserted successfully!");
            console.log(result);
           
    }catch(err){
        console.log(err)
    }
}

createDocument();
Error: PlayList validation failed: marks: marks count should not be negative