2

I'm new to RavenDB and wonder what is the difference between those two:

With:

var cus = _rdb.Session.Query<Customer>().Take(int.MaxValue)  
  .Where(x =>  x.Id != "-3"  );

Without:

var cus = _rdb.Session.Query<Customer>()  
  .Where(x =>  x.Id != "-3"  );

thanks

Keith
  • 20,636
  • 11
  • 84
  • 125
Zulu Z
  • 1,103
  • 5
  • 14
  • 27
  • Can you please clarify your question? Why adding `.Take(int.MaxValue)` should make any sense? – Petr Abdulin Jul 19 '13 at 04:14
  • I have inherited some code which populates grid and this statement Take(int.MaxValue) is everywhere. Not sure yet how raven works but why I would take all documents with querying ravendb? I have notice that omitting this Take also work mostly fine but I'd like to understand the difference. – Zulu Z Jul 19 '13 at 04:40
  • Ok, got it. This is the case: http://stackoverflow.com/questions/10048943/proper-way-to-retrieve-more-than-128-documents-with-ravendb – Petr Abdulin Jul 19 '13 at 05:16
  • oh, thanks! so without Take I get on 127 records matching where condition. – Zulu Z Jul 19 '13 at 11:40

1 Answers1

4

In the first case, you'll get up to 1,024 items. In the second case, you'll get up to 128 items.

We actively discard the int.MaxValue when you try to use that.

Ayende Rahien
  • 22,925
  • 1
  • 36
  • 41