@@ -43,6 +43,7 @@ public abstract class MongoCursor : IEnumerable
4343 private IMongoFields _fields ;
4444 private BsonDocument _options ;
4545 private QueryFlags _flags ;
46+ private TimeSpan ? _maxAwaitTime ;
4647 private ReadConcern _readConcern = ReadConcern . Default ;
4748 private ReadPreference _readPreference ;
4849 private IBsonSerializer _serializer ;
@@ -165,6 +166,22 @@ public virtual QueryFlags Flags
165166 }
166167 }
167168
169+ /// <summary>
170+ /// Gets or sets the maximum await time for TailableAwait cursors.
171+ /// </summary>
172+ /// <value>
173+ /// The maximum await time for TailableAwait cursors.
174+ /// </value>
175+ public virtual TimeSpan ? MaxAwaitTime
176+ {
177+ get { return _maxAwaitTime ; }
178+ set
179+ {
180+ if ( _isFrozen ) { ThrowFrozen ( ) ; }
181+ _maxAwaitTime = value ;
182+ }
183+ }
184+
168185 /// <summary>
169186 /// Gets the read concern.
170187 /// </summary>
@@ -332,6 +349,7 @@ public virtual MongoCursor Clone(Type documentType, IBsonSerializer serializer)
332349 clone . _flags = _flags ;
333350 clone . _skip = _skip ;
334351 clone . _limit = _limit ;
352+ clone . _maxAwaitTime = _maxAwaitTime ;
335353 clone . _batchSize = _batchSize ;
336354 clone . _fields = _fields ;
337355 return clone ;
@@ -511,6 +529,18 @@ public virtual MongoCursor SetMax(BsonDocument max)
511529 return this ;
512530 }
513531
532+ /// <summary>
533+ /// Sets the maximum await time for tailable await cursors.
534+ /// </summary>
535+ /// <param name="value">The value.</param>
536+ /// <returns>The cursor (so you can chain method calls to it).</returns>
537+ public virtual MongoCursor SetMaxAwaitTime ( TimeSpan ? value )
538+ {
539+ if ( _isFrozen ) { ThrowFrozen ( ) ; }
540+ _maxAwaitTime = value ;
541+ return this ;
542+ }
543+
514544 /// <summary>
515545 /// Sets the maximum number of documents to scan.
516546 /// </summary>
@@ -799,6 +829,7 @@ public virtual IEnumerator<TDocument> GetEnumerator()
799829 CursorType = cursorType ,
800830 Filter = queryDocument ,
801831 Limit = Limit ,
832+ MaxAwaitTime = MaxAwaitTime ,
802833 Modifiers = Options ,
803834 NoCursorTimeout = noCursorTimeout ,
804835 Projection = Fields . ToBsonDocument ( ) ,
@@ -894,6 +925,16 @@ public virtual IEnumerator<TDocument> GetEnumerator()
894925 return ( MongoCursor < TDocument > ) base . SetMax ( max ) ;
895926 }
896927
928+ /// <summary>
929+ /// Sets the maximum await time for tailable await cursors.
930+ /// </summary>
931+ /// <param name="value">The value.</param>
932+ /// <returns>The cursor (so you can chain method calls to it).</returns>
933+ public new virtual MongoCursor SetMaxAwaitTime ( TimeSpan ? value )
934+ {
935+ return ( MongoCursor < TDocument > ) base . SetMaxAwaitTime ( value ) ;
936+ }
937+
897938 /// <summary>
898939 /// Sets the maximum number of documents to scan.
899940 /// </summary>
0 commit comments