我的代码是删除_id
DBCollection collection = db.getCollection("volume");
DBCursor cursor = collection.find();
DBObject resultElement = cursor.next();
Map resultElementMap = resultElement.toMap();
System.out.println(resultElementMap);
,其结果是:
{_id = 521b509d20954a0aff8d9b02,标题= { “文”: “卷工作 订单”, “x”:-20.0} xAxis = {“title”:{“text”:“2012”}, “categories”:[“Jan”,“Feb”,“Mar”,“Apr” ,“Jun”,“Jul” ,“Aug”,“Sep”,“Oct”,“Nov”,“Dec”]},yAxis = {“min”:1000.0, “max”:7000.0“title “:{”text“:”Volume(K)“}, “plotLines”:[{“{标签”:{“text”:“平均”,“x”:25.0},“颜色”:“黑色”, “width”:2.0,“value”:30.0,“dashStyle “:”solid“}]},legend = {”backgroundColor“:”#FFFFFF“,”reversed“:true},series = [{”name“ :”Volume“,”showInLegend“:false, “:[2909.0,3080.0,4851.0 ,3087.0,2960.0,2911.0,1900.0,3066.0,3029.0,5207.0,3056.0,3057.0]}]}
我需要从结果中移除_id。我知道我需要玩弄collection.find(),但请任何人都可以帮助我?我没能获得sesired结果
真棒..作品像魅力..谢谢很多兄弟... – user2572739