public String ForDate(String date) {
MongoCursor cursor = collection.find(eq(\"date\", date)).iterator();
basicb b = new basicb();
while (cur
Probably, the problem is that you are calling next
method three times in a single loop. You should call it once and store its result in a variable, since next
retrieves next element in the iteration
while (cursor.hasNext()) {
Document element = cursor.next();
b.setDepartament(element.getString("departament"));
b.setText(element.getString("text"));
b.setTitle(element.getString("title"));
lista.add(b);
}