MongoError: Document failed validation - How to insert both float and int into the same field - which is marked as double?
问题 I'm having problems with inserting into mongoDB because good objects don't pass the mongoDB validator . To make it worse, the error is a generic: Document failed validation which in a big multi-nested object can make things confusing regarding where exactly this validation fails. myValidatorIs = { validator: { $jsonSchema : { bsonType: "object" , required: [ "price" ] , properties: { price: { bsonType: "double" // price needs to be a double, tried with decimal also. , description: "must be a