0
我有以下...DBCursor hasNext似乎只能返回1個結果時,它應該返回2
DBCollection dbc = test.getCollection();
double count = dbc.count();
DBCursor cursor = dbc.find();
StringBuilder sb = new StringBuilder();
if(cursor.hasNext())
sb.append(cursor.next().toString());
這隻能輸出一個記錄,但表示2.計數這一個似乎工作...
DBCollection dbc = test.getCollection();
double count = dbc.count();
DBCursor cursor = dbc.find();
StringBuilder sb = new StringBuilder();
for(double i = 0.0; i<count; i++)
sb.append(cursor.next().toString());
我缺少什麼