. Example of {@link Cursor}
--
// create/open a database
Nitrite db = Nitrite.builder()
.openOrCreate("user", "password");
public interface Cursor extends RecordIterable<Document>
An interface to iterate over database find()
results. It provides a
mechanism to iterate over all NitriteId
s of the result.
. Example of {@link Cursor}
--
// create/open a database
Nitrite db = Nitrite.builder()
.openOrCreate("user", "password");
// create a collection named - test NitriteCollection collection = db.getCollection("test");
// returns all ids un-filtered Cursor result = collection.find();
for (Document doc : result) { // use your logic with the retrieved doc here }
To create an iterator over the documents instead of the ids,
call on the Cursor .
|
Modifier and Type | Method and Description |
---|---|
RecordIterable<Document> |
project(Document projection)
Gets a lazy iterable containing all the selected keys of the result documents.
|
firstOrDefault, hasMore, size, toList, totalCount
reset
RecordIterable<Document> project(Document projection)
Gets a lazy iterable containing all the selected keys of the result documents.
projection
- the selected keys of a result document.