MongoDB.Driver.MongoCommandException: Command getMore failed: Cursor not found, cursor id: 16494659487.
at MongoDB.Driver.Core.WireProtocol.CommandWireProtocol`1.ProcessReply(ConnectionId connectionId, ReplyMessage`1 reply)
at MongoDB.Driver.Core.WireProtocol.CommandWireProtocol`1.Execute(IConnection connection, CancellationToken cancellationToken)
at MongoDB.Driver.Core.Servers.ClusterableServer.ServerChannel.ExecuteProtocol[TResult](IWireProtocol`1 protocol, CancellationToken cancellationToken)
at MongoDB.Driver.Core.Servers.ClusterableServer.ServerChannel.Command[TResult](DatabaseNamespace databaseNamespace, BsonDocument command, IElementNameValidator commandValidator, Func`1 responseHandling, Boolean slaveOk, IBsonSerializer`1 resultSerializer, MessageEncoderSettings messageEncoderSettings, CancellationToken cancellationToken)
at MongoDB.Driver.Core.Operations.AsyncCursor`1.ExecuteGetMoreCommand(IChannelHandle channel, CancellationToken cancellationToken)
at MongoDB.Driver.Core.Operations.AsyncCursor`1.GetNextBatch(CancellationToken cancellationToken)
at MongoDB.Driver.Core.Operations.AsyncCursor`1.MoveNext(CancellationToken cancellationToken)
at MongoDB.Driver.Core.Operations.AsyncCursorEnumerator`1.MoveNext()
<package id="MongoDB.Bson" version="2.2.0" targetFramework="net452" />
<package id="MongoDB.Driver" version="2.2.0" targetFramework="net452" />
<package id="MongoDB.Driver.Core" version="2.2.0" targetFramework="net452" />
try
{
var mylist = database.GetCollection<MyClass>("MyCollectionName");
var cursor = mylist.Find(x => x.Subdocument.Any(y => y.BoolValue == false)).ToCursor();
foreach (var myObject in cursor.ToEnumerable())
{
Console.WriteLine();
Console.WriteLine("myObject-ID: " + myObject.myObjectId);
var myObjectChanged = false;
var subDocs = myObject.Subdocument.Where(x => x.BoolValue == false).ToList();
var subDocCount = subDocs.Count;
for (var i = 0; i < subDocCount; i++)
{
var myObject = subDocs[i];
...
if (...)
{
myObjectChanged = true;
}
}
if (myObjectChanged)
{
mylist.ReplaceOne(x => x.myObjectId == myObject.myObjectId, myObject);
}
}
}
catch (Exception ex)
{
Console.WriteLine(ex);
}
--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
For other MongoDB technical support options, see: http://www.mongodb.org/about/support/.
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user...@googlegroups.com.
To post to this group, send email to mongod...@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/589b4551-66d9-4d6c-b6e3-f49c4249720b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
var findOptions = new FindOptions {NoCursorTimeout = true};
var count = myList.Find(filter).Count();
using (var cursor = myList.Find(filter, findOptions).ToCursor())
{
while (cursor.MoveNext())
{
var index = 0;
foreach (var myObject in cursor.Current)
{
--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
For other MongoDB technical support options, see: http://www.mongodb.org/about/support/.
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user...@googlegroups.com.
To post to this group, send email to mongod...@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/056e2800-e31c-40dd-bb57-15962822ae79%40googlegroups.com.