java - Invalid BSON field name when using dot notation -
so i've finished writing this:
https://gist.github.com/exception/c46dc2ee727c7cefc61c4e0be59fac16
however when using following code
persistentstatistics statistics = np.getpersistentstats(); statistics.getintegerstatistics(gameregistry.type.thimble).increment("testing", 1); statistics.persist();
to execute persistantstatistics#persist
debugging prints following:
[19:16:00 info]: size 1 [19:16:00 info]: statistics integers [19:16:00 info]: statparent document{{$inc=document{{testing=1}}}} [19:16:00 info]: parent document{{integers=document{{$inc=document{{testing=1}}}}}}
and outputs following exception:
[19:16:00 warn]: caused by: java.lang.illegalargumentexception: invalid bson field name integers [19:16:00 warn]: @ org.bson.abstractbsonwriter.writename(abstractbsonwriter.java:516) [19:16:00 warn]: @ org.bson.codecs.documentcodec.writemap(documentcodec.java:188) [19:16:00 warn]: @ org.bson.codecs.documentcodec.encode(documentcodec.java:131) [19:16:00 warn]: @ org.bson.codecs.documentcodec.encode(documentcodec.java:45) [19:16:00 warn]: @ org.bson.codecs.bsondocumentwrappercodec.encode(bsondocumentwrappercodec.java:63) [19:16:00 warn]: @ org.bson.codecs.bsondocumentwrappercodec.encode(bsondocumentwrappercodec.java:29) [19:16:00 warn]: @ com.mongodb.connection.updatecommandmessage.writethewrites(updatecommandmessage.java:85) [19:16:00 warn]: @ com.mongodb.connection.updatecommandmessage.writethewrites(updatecommandmessage.java:43) [19:16:00 warn]: @ com.mongodb.connection.basewritecommandmessage.encodemessagebodywithmetadata(basewritecommandmessage.java:129) [19:16:00 warn]: @ com.mongodb.connection.requestmessage.encodewithmetadata(requestmessage.java:160) [19:16:00 warn]: @ com.mongodb.connection.writecommandprotocol.sendmessage(writecommandprotocol.java:220) [19:16:00 warn]: @ com.mongodb.connection.writecommandprotocol.execute(writecommandprotocol.java:101) [19:16:00 warn]: @ com.mongodb.connection.updatecommandprotocol.execute(updatecommandprotocol.java:64) [19:16:00 warn]: @ com.mongodb.connection.updatecommandprotocol.execute(updatecommandprotocol.java:37) [19:16:00 warn]: @ com.mongodb.connection.defaultserver$defaultserverprotocolexecutor.execute(defaultserver.java:168) [19:16:00 warn]: @ com.mongodb.connection.defaultserverconnection.executeprotocol(defaultserverconnection.java:289) [19:16:00 warn]: @ com.mongodb.connection.defaultserverconnection.updatecommand(defaultserverconnection.java:143) [19:16:00 warn]: @ com.mongodb.operation.mixedbulkwriteoperation$run$3.executewritecommandprotocol(mixedbulkwriteoperation.java:490) [19:16:00 warn]: @ com.mongodb.operation.mixedbulkwriteoperation$run$runexecutor.execute(mixedbulkwriteoperation.java:656) [19:16:00 warn]: @ com.mongodb.operation.mixedbulkwriteoperation$run.execute(mixedbulkwriteoperation.java:409) [19:16:00 warn]: @ com.mongodb.operation.mixedbulkwriteoperation$1.call(mixedbulkwriteoperation.java:177) [19:16:00 warn]: @ com.mongodb.operation.mixedbulkwriteoperation$1.call(mixedbulkwriteoperation.java:168) [19:16:00 warn]: @ com.mongodb.operation.operationhelper.withconnectionsource(operationhelper.java:422) [19:16:00 warn]: @ com.mongodb.operation.operationhelper.withconnection(operationhelper.java:413) [19:16:00 warn]: @ com.mongodb.operation.mixedbulkwriteoperation.execute(mixedbulkwriteoperation.java:168) [19:16:00 warn]: @ com.mongodb.operation.mixedbulkwriteoperation.execute(mixedbulkwriteoperation.java:74) [19:16:00 warn]: @ com.mongodb.mongo.execute(mongo.java:845) [19:16:00 warn]: @ com.mongodb.mongo$2.execute(mongo.java:828) [19:16:00 warn]: @ com.mongodb.mongocollectionimpl.executesinglewriterequest(mongocollectionimpl.java:550) [19:16:00 warn]: @ com.mongodb.mongocollectionimpl.update(mongocollectionimpl.java:542) [19:16:00 warn]: @ com.mongodb.mongocollectionimpl.updateone(mongocollectionimpl.java:381) [19:16:00 warn]: @ net.minespree.feather.player.stats.persitent.persistentstatistics.persist(persistentstatistics.java:111) [19:16:00 warn]: @ net.minespree.feather.command.essentialcommands.test(essentialcommands.java:38) [19:16:00 warn]: ... 12 more
is of i'm doing in class wrong, or missing supposed spot?
Comments
Post a Comment