简体   繁体   English

什么是通过编程设置的上限收集限制

[英]what is the Capped collection limit via programing

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我尝试通过 java/Spring 数据编程创建/修改上限集合,我正在使用 BasicDBObject,我的 Map 将设置在该 dbObject 中,当我尝试运行程序时,小 int 值工作正常,但如果我 go 具有 2 GB 的 int值然后错误就像 int 值太长一样

I tried different datatype (BigInt,long,String.. etc ) its giving error, The program only expecting int value not other datatype.我尝试了不同的数据类型(BigInt、long、String.. 等)它给出的错误,该程序只期望 int 值而不是其他数据类型。

  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);}

i added 2147483648l then its working fine我添加了 2147483648l 然后它工作正常

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM