Java操作mongodb小记

JSONArray jsonArr = JSONArray.fromObject(menuContent);
			JSONObject jsonObj = null;
			Mongo mongo = new Mongo(ResourceUtil.getConfigByName("MongoDB_IP"), Integer.valueOf(ResourceUtil.getConfigByName("MongoDB_Port")));
			DB db = mongo.getDB(ResourceUtil.getConfigByName("MongoDB_Dbname"));
			DBCollection menu = db.getCollection("Menu");
			DBCursor menuCursor = null;
			long count = 0;
			BasicDBList dbList = null;
			boolean insertFlag = false;
			for(int i=0,len=jsonArr.size();i

你可能感兴趣的:(java)