nested exception is com.mongodb.MongoWriteException: The field 'status' must be an array but is of

org.springframework.dao.DataIntegrityViolationException: The field 'status' must be an array but is of type int in document {_id: ObjectId('5d1c09e7638283e1cbf82db')}; nested exception is com.mongodb.MongoWriteException: The field 'status' must be an array but is of type int in document {_id: ObjectId('5d1c09e7638723e1cbf82db')}


解决:
将Update  update  = new Update();
update.put("key","");
改成:Update  update  = new Update();
update.set("key","");

你可能感兴趣的:(java,mongo)