Hi
I posted this question on MongoDB c# driver group...but I've not received any response...hence posting it here.
I'm trying to fetch some records based on a simple query. The code snippet is posted below. The query is supposed to return 3000K records...but when I execute, the application blocks after getting 100 records. Then after couple of minutes it fetches the remaining N records. Is there a config setting I'm missing? Has anyone experienced similar issue?
Running MongoDB 2.4.3
I have the right indexes and verified using explain that the query is using the same index.
MongoClient client = new MongoClient("mongodb://myserver:27017"); // connect to localhost
MongoServer server = client.GetServer();
MongoDatabase omni = server.GetDatabase("MyDB");
MongoCollection<BsonDocument> coll = omni.GetCollection<BsonDocument>("MyCollection");
var query = Query.And(Query.Matches("category", "foo"),
Query.Matches("refid", "bar"),
Query.Exists("Topic_ID")
);
int count = 0;
var cursor = coll.Find(query);
foreach (var doc in cursor)
{
Console.WriteLine("i=" + (++count));
}
NOTE: For testing purposes I removed the query and changed it to "findAll()"; event then in the first iteration Mongo returns ~ 100 records and then on each iteration it pauses for 30 secs and returns 7K at a time. Why does it pause?
Thanks
MyCom