I am using mongoose. My schema is like
var tblTypes = new Schema({
_id: { type: String, required: true }
, desc: String
, priority: Number
}, { collection: 'tblTypes' });
while fetching records in the query i am giving like dis as query in findone
JSON
{ _id: "SFK" }
Its giving
{ message: 'Cast to ObjectId failed for value "CONFIRM" at path "_id"',
name: 'CastError',
type: 'ObjectId',
value: 'CONFIRM',
path: '_id' }
as error. Earlier its working in different system. I am not sure about both the versions. Where i am going wrong ?