Reputation: 1525
I know the fact that I can't get more than 128 records by one query and that this can be extended to 1024 if I use .Take(1024) but I have a new problem with this Code on the sample Database:
var albumCount = session.Query<Album>().Count();
Console.WriteLine(albumCount); // 246 as expected?!?
var somemoredata = session.Query<Album>();
Console.WriteLine(somemoredata.Count()); // 246 but it sould be 128
int cnt = 1;
foreach (var album in somemoredata)
{
Console.WriteLine(cnt++.ToString() + " " + album.Id); // repeats 128 counts
}
How can this be? The Count of somemoredata is 246, but the foreach writes 128 Lines?!?
Where is the error?
Upvotes: 1
Views: 148
Reputation: 9163
Take
is doing paging for you, which is part of the save by default principle. But Count
should always give the actual count of the documents for that query.
This will ensure that you can:
Upvotes: 2