Hibernating Rhinos Ltd
Oren Eini l CEO l Mobile: + 972-52-548-6969
Office: +972-4-622-7811 l Fax: +972-153-4-622-7811
--
You received this message because you are subscribed to the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
public class TakeUnboundedDocumentQueryListener : IDocumentQueryListener
{
public void BeforeQueryExecuted(IDocumentQueryCustomization queryCustomization)
{
queryCustomization.BeforeQueryExecution(q=>q.PageSize=int.MaxValue);
}
}
var list = session.Query<Entity>().ToList();
Hibernating Rhinos Ltd
Oren Eini l CEO l Mobile: + 972-52-548-6969
Office: +972-4-622-7811 l Fax: +972-153-4-622-7811
I've read a similar discussion while researching...
https://groups.google.com/forum/#!topic/ravendb/Eo96fqoyVvc
I do tend to agree with rfuller here. There is a constant discussion about 'what if you return an unbounded set' - to be frank the 'safety' has caused more hidden bugs (with things failing after 1024 results) than problems it has solved.I would argue the programmer is as or more likely to forget about the bounded-by-default result than the unbounded set.
My guess is 10 out of 10 business managers (non techies) would rather it fail because you were too successful and couldnt deal with 1,000,000 records vs the alternative where it silently 'fails' at 1,024 records.
Hibernating Rhinos Ltd
Oren Eini l CEO l Mobile: + 972-52-548-6969
Office: +972-4-622-7811 l Fax: +972-153-4-622-7811
--
public class TakeUnboundedDocumentQueryListener : IDocumentQueryListener { public void BeforeQueryExecuted(IDocumentQueryCustomization queryCustomization) { queryCustomization.BeforeQueryExecution(q =>
{ if(!q.PageSizeSet) q.PageSize = int.MaxValue; }); } }