Link to home
Start Free TrialLog in
Avatar of Sathish David  Kumar N
Sathish David Kumar NFlag for India

asked on

.DataIntegrityViolationException: Cannot change the size of a document in a capped collection: 311 != 333

using the below code I have created capped collection for my document , while i am doing insert i am facing .dao.DataIntegrityViolationException: Cannot change the size of a document in a capped collection: 311 != 333; How to resolve this

 Map<String, Object> commandArguments = new BasicDBObject();
    commandArguments.put(CONVERT_TO_CAPPED,COLLECTION_NAME);
    commandArguments.put(SIZE, 2147483648l);
    BasicDBObject command = new BasicDBObject(commandArguments);
    Document commandResult = database.runCommand(command);}

Open in new window

User generated image

ASKER CERTIFIED SOLUTION
Avatar of girionis
girionis
Flag of Greece image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial