Skip to content

Commit 81afedc

Browse files
committed
RR feedback
1 parent cecf51f commit 81afedc

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

Diff for: source/crud/query/cursors.txt

+8-8
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ Overview
2323
In this guide, you can learn how to access data from a **cursor** by using the
2424
{+driver-short+}.
2525

26-
A cursor is a mechanism that returns the results of a read operation in iterable
26+
A cursor is a tool that returns the results of a read operation in iterable
2727
batches. Because a cursor holds only a subset of documents at any given time,
2828
cursors reduce both memory consumption and network bandwidth usage.
2929

30-
You can retrieve a cursor by using the ``FindSync()`` and ``FindAsync()`` methods. You can
30+
You can retrieve a cursor by using the ``FindSync()`` or ``FindAsync()`` method. You can
3131
also convert the results of the ``Find()`` method to a cursor by chaining the ``ToCursor()``
3232
or ``ToCursorAsync()`` method.
3333

@@ -107,7 +107,7 @@ Retrieve All Documents
107107
.. warning::
108108

109109
If the number and size of documents returned by your query exceeds available
110-
application memory, your program will crash. If you expect a large result
110+
application memory, your program might crash. If you expect a large result
111111
set, :ref:`access your cursor iteratively <csharp-cursors-iterate>`.
112112

113113
To retrieve all documents from a cursor, use the ``ToList()`` method, as shown in the
@@ -139,11 +139,11 @@ Tailable Cursors
139139

140140
When querying on a :manual:`capped collection </core/capped-collections/>`, you
141141
can use a **tailable cursor** that remains open after the client exhausts the
142-
results in a cursor. To create a tailable cursor with capped collection,
143-
set the ``CursorType`` option of a ``FindOptions`` object to ``CursorType.TailableAwait``
144-
and pass this ``FindOptions`` object to the find method of your choice. The following example
145-
shows how to create a tailable cursor on a capped collection. Select the :guilabel:`Synchronous`
146-
or :guilabel:`Asynchronous` tab to see the corresponding code:
142+
results in a cursor. To create a tailable cursor, create a ``FindOptions`` object and set the
143+
``CursorType`` property to ``CursorType.TailableAwait``. Then, pass the ``FindOptions`` object
144+
to one of the find operation methods. The following example shows how to create a tailable
145+
cursor on a capped collection. Select the :guilabel:`Synchronous` or
146+
:guilabel:`Asynchronous` tab to see the corresponding code:
147147

148148
.. tabs::
149149

Diff for: source/includes/fundamentals/code-examples/Cursor.cs

+6-6
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public static async Task Main(string[] args)
1616

1717
{
1818
// start-cursor-iterate
19-
var filter = Builders<Restaurant>.Filter.Empty;
19+
var filter = Builders<Restaurant>.Filter.Eq(r => r.Name, "Starbucks");
2020

2121
using (var cursor = collection.FindSync(filter))
2222
{
@@ -33,7 +33,7 @@ public static async Task Main(string[] args)
3333

3434
{
3535
// start-cursor-iterate-async
36-
var filter = Builders<Restaurant>.Filter.Empty;
36+
var filter = Builders<Restaurant>.Filter.Eq(r => r.Name, "Starbucks");
3737

3838
using (var cursor = await collection.FindAsync(filter))
3939
{
@@ -50,7 +50,7 @@ public static async Task Main(string[] args)
5050

5151
{
5252
// start-cursor-iterate-to-cursor
53-
var filter = Builders<Restaurant>.Filter.Empty;
53+
var filter = Builders<Restaurant>.Filter.Eq(r => r.Name, "Starbucks");
5454

5555
using (var cursor = collection.Find(filter).ToCursor())
5656
{
@@ -67,7 +67,7 @@ public static async Task Main(string[] args)
6767

6868
{
6969
// start-cursor-iterate-to-cursor-async
70-
var filter = Builders<Restaurant>.Filter.Empty;
70+
var filter = Builders<Restaurant>.Filter.Eq(r => r.Name, "Starbucks");
7171

7272
using (var cursor = await collection.Find(filter).ToCursorAsync())
7373
{
@@ -110,7 +110,7 @@ public static async Task Main(string[] args)
110110
{
111111
foreach (var restaurant in cursor.Current)
112112
{
113-
// Process each restaurant
113+
Console.WriteLine(restaurant.Name);
114114
}
115115
}
116116
}
@@ -132,7 +132,7 @@ public static async Task Main(string[] args)
132132
{
133133
foreach (var restaurant in cursor.Current)
134134
{
135-
// Process each restaurant
135+
Console.WriteLine(restaurant.Name);
136136
}
137137
}
138138
}

0 commit comments

Comments
 (0)