-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 0.9
-
Component/s: None
-
None
-
Environment:OS:WIn7 x64 Enterprise
VS:VS2010
I have a collection contains about 821463 documents in my local mongodb.I try to distinct TrackID in C# Program with the method Distinct(string key) of MongoCollection.I got a Exception,Message is:
Invalid BSONObj spec size: 25354392 (98E08201)
The stack trace is below:
At MongoDB.Driver.Internal.MongoReplyMessage`1.ReadFrom(BsonBuffer buffer)
At MongoDB.Driver.Internal.MongoConnection.ReceiveMessage[TDocument]()
At MongoDB.Driver.MongoCursor`2.MongoCursorEnumerator.GetReply(MongoRequestMessage message)
At MongoDB.Driver.MongoCursor`2.MongoCursorEnumerator.GetFirst()
At MongoDB.Driver.MongoCursor`2.MongoCursorEnumerator.MoveNext()
At System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
At MongoDB.Driver.MongoCollection.FindOneAs[TQuery,TDocument](TQuery query)
At MongoDB.Driver.MongoCollection`1.FindOne[TQuery](TQuery query)
At MongoDB.Driver.MongoDatabase.RunCommand[TCommand](TCommand command)
At MongoDB.Driver.MongoCollection.Distinct[TQuery](String key, TQuery query)
At MongoDB.Driver.MongoCollection.Distinct(String key)
At MongoWriteSpeed.Program.Main(String[] args) Location E:\Program\WindowsProject\MongoWriteSpeed\MongoWriteSpeed\Program.cs:row 27
My Program is Below:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MongoDB.Driver;
using MongoDB.Bson;
namespace MongoWriteSpeed
{
class Program
{
static void Main(string[] args)
{
MongoServer _dbServer = MongoServer.Create();
try
{
if ((_dbServer.State == MongoServerState.Disconnected) || (_dbServer.State == MongoServerState.None))
}
catch (Exception ex)
{
System.Console.WriteLine(string.Format("Faile?Exception?
", ex.Message));
}
finally
}
}
}