【问题标题】:c# mongodb cursor not found时间:2019-05-10 标签:c#mongodb cursor not found
【发布时间】:2014-07-19 11:55:42
【问题描述】:

我想知道为什么我得到一个异常告诉我“找不到光标”。 我在服务器中有 500 万个数据,我有我的程序来获取所有这些数据,但它在解析这些数据并在循环中获取 eans 数小时后停止。

var libris = LibriCollection.FindAll().SetFields("doc.product.productidentifier");
            List<string> eans = new List<string>();
            foreach (var product in libris)
            {

                eans.Add(product.doc["product"]["productidentifier"]["b244"].AsString;
            }

【问题讨论】:

    标签: c# mongodb


    【解决方案1】:

    You need to disable to cursor timeout.

    cursor.SetFlags(QueryFlags.NoCursorTimeout);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-12-24
      • 1970-01-01
      • 2020-06-15
      • 2020-10-01
      • 2015-06-14
      • 2011-07-08
      • 2012-02-03
      • 2017-04-15
      相关资源
      最近更新 更多