我有以下代码:
mongoClient = new MongoClient( "localhost" , 27017 );
db = mongoClient.getDB("hcm");
DBCollection coll = db.getCollection("segment_cell_details");
BasicDBObject query = new BasicDBObject("cell_x", cell_x).append("cell_y", cell_y);
DBCursor cursor = coll.find(query);
接下来,我想在 memcached 中添加 DBCursor :
c = new MemcachedClient(AddrUtil.getAddresses("localhost:11211"));
c.add("Key", 3600, cursor);
然后,系统打印出“Non-serializable object error”
那么,如何将查询结果添加到 memcached ?