concept cursor in category mongoDB

appears as: cursors, cursor, The cursor, cursor
MongoDB in Action, Second Edition: Covers MongoDB version 3.0

This is an excerpt from Manning's book MongoDB in Action, Second Edition: Covers MongoDB version 3.0.

  • Aggregation improvements —Aggregation has various improvements in this version. It can stream data over cursors, it can output to collections, and it has many new supported operators and pipeline stages, among many other features and performance improvements.
  • The results are returned in a Mongo::Collection::View object, which extends Iterable and makes it easy to iterate through the results. We’ll discuss cursors in more detail in Section 3.2.3. In the meantime, you can fetch the results of the $gt query:

    cursor = @comments.find.sort("created")
    print_threaded_list(cursor)