I have this schema in my mongo db.
const movieSchema = new mongoose.Schema({
title: String,
year: Number,
score: Number,
rating: String
})
When I tried to delete collections with year greater than 1999, I have mistakenly put the condition as:
Movie.deleteMany({yeaer: {$gte: 1999}}).then(res => {console.log(res)})