I have a strange problem and cannot figure out what the problem is. The Error-message doesn\'t help.
I\'m sending an "alarm" to the server and want to save
Maybe it is too late, but here mongoose is assuming that deviceId is not an object and it is of type String
deviceId: { type : String, index : { unique : true, dropDups : true } },
SIMPLE SOLUTION:
deviceId: { type: { type: String }, index: { unique: true, dropDups: true } },