jjzjj

AggregationOptions

全部标签

java - 什么取代了 MongoDB AggregationOutput 类?

所有方法都已被弃用,但我无法找到用于与java驱动程序聚合的替代类。 最佳答案 感谢evachooly的回答,这是要做的。替换:AggregationOutputoutput=collection.aggregate(pipe);for(DBObjectobj:output.results()){//...}通过//thisbuildofoptionsistakenfromtheoriginalmethod//aggregate(pipe)tohavesamebehaviourAggregationOptionsoptions=Ag

Java/MongoDB - 如何解决错误 "exception: pipeline element 0 is not an object"

我正在使用aggregate()方法并在游标中查找我正在使用以下代码的结果dbObjArray=newBasicDBObject[2]dbObjArray[0]=cruxLeveldbObjArray[1]=project//dbObjArray[2]=outListpipeline=Arrays.asList(dbObjArray)if(!datasetObject?.isFlat&&jsonFor!='collection-grid'){println'--------------------------------insideifblockbbb-----------------