Issue
I try to create/Modify capped collection via java/Spring data programing , I am using BasicDBObject and my Map will set in that dbObject , While i try to run the program , Small int value working fine but If i go with 2 GB of int value then error coming like as int values too long
I tried different datatype (BigInt,long,String .. etc ) its giving error , The program only expecting int value not other datatype .
Map<String, Object> commandArguments = new BasicDBObject();
commandArguments.put(CONVERT_TO_CAPPED,COLLECTION_NAME);
commandArguments.put(SIZE, 2147483648);
BasicDBObject command = new BasicDBObject(commandArguments);
Document commandResult = database.runCommand(command);}
Solution
I changed
commandArguments.put(SIZE, 2147483648);
to
commandArguments.put(SIZE, 2147483648l);
Answered By - Sathish David Kumar