I have my source code below using coffeescript:
`personSchema = new mongoose.Schema({
name: String,
age: Number
})
Person = mongoose.model('Person', personSchema)
options = {
sort: { age: -1 }
}
Person.findOne({}, null, options, (err, result) ->
if err
console.error('err:', err)
else
console.log('result:', result)
)`
Even though the sort value I am using is in the correct syntax for sort query. But every now and then I get the above error. Do you know the reason why?
Version coffee-script: 1.7.1
mongoose: 4.10.6
mquery: 2.3.3
mongodb: 2.2.34