java - MongoDB BSON size exceeded even when using GridFS -
i seeing error while saving documents in gridfs (mongodb version: 2.4.9)
2015-05-15 10:19:15,409 error [stderr] com.mongodb.mongointernalexception: dbobject of size 160038724 on max bson size 16777216 2015-05-15 10:19:15,409 error [stderr] @ com.mongodb.outmessage.putobject(outmessage.java:291) 2015-05-15 10:19:15,410 error [stderr] @ com.mongodb.outmessage.writeupdate(outmessage.java:175) 2015-05-15 10:19:15,410 error [stderr] @ com.mongodb.outmessage.update(outmessage.java:62) 2015-05-15 10:19:15,410 error [stderr] @ com.mongodb.dbapilayer$mycollection.update(dbapilayer.java:326) 2015-05-15 10:19:15,410 error [stderr] @ com.mongodb.dbcollection.update(dbcollection.java:160) 2015-05-15 10:19:15,410 error [stderr] @ com.mongodb.dbcollection.save(dbcollection.java:800) 2015-05-15 10:19:15,410 error [stderr] @ com.mongodb.dbcollection.save(dbcollection.java:768) 2015-05-15 10:19:15,410 error [stderr] @ com.mongodb.gridfs.gridfsfile.save(gridfsfile.java:54) 2015-05-15 10:19:15,410 error [stderr] @ com.test.service.state.mongostateops.update(mongostateops.java:87) 2015-05-15 10:19:15,410 error [stderr] @ com.test.service.state.impl.stateoutputmarshallerimpl$1.run(stateoutputmarshallerimpl.java:45) 2015-05-15 10:19:15,410 error [stderr] @ java.util.concurrent.threadpoolexecutor$worker.runtask(threadpoolexecutor.java:886) 2015-05-15 10:19:15,410 error [stderr] @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:908) 2015-05-15 10:19:15,410 error [stderr] @ java.lang.thread.run(thread.java:662)
here code:
public void update(string correlatorid, byte[] bytes) { date = new date(system.currenttimemillis()); if ( gfs ) { gridfsdbfile state = gridfs.findone(correlatorid); state.put( correlatorlastmodificationdatemappingfield, ); state.put( correlatorbytesmappingfield, bytes ); state.save(); } }
any appreciated. here detailed mongodb information:
db.runcommand("buildinfo") { "version" : "2.4.9", "gitversion" : "52fe0d21959e32a5bdbecdc62057db386e4e029c", "sysinfo" : "linux ip-10-2-29-40 2.6.21.7-2.ec2.v1.2.fc8xen #1 smp fri nov 20 17:48:28 est 2009 x86_64 boost_lib_version=1_49", "loaderflags" : "-fpic -pthread -rdynamic", "compilerflags" : "-wnon-virtual-dtor -woverloaded-virtual -fpic -fno-strict-aliasing -ggdb -pthread -wall -wsign-compare -wno-unknown-pragmas -winvalid-pch -werror -pipe -fno-builtin-memcmp -o3", "allocator" : "tcmalloc", "versionarray" : [ 2, 4, 9, 0 ], "javascriptengine" : "v8", "bits" : 64, "debug" : false, "maxbsonobjectsize" : 16777216, "ok" : 1 }
did "maxbsonobjectsize" valid collection documents or deals gridfs too?
cheers
Comments
Post a Comment