Can I be lazy with "Any" queries

20 views
Skip to first unread message

Nick

unread,
Dec 12, 2017, 1:45:34 PM12/12/17
to RavenDB - 2nd generation document database

Hi,

I would like to write a set of lazy queries against an index. The ultimate goal is to test if each query's Any() call returns something or not (i.e. if the index contains a specific entry).
Since I don't care about the entities in themselves, I would like to avoid returning data sets from the db server... But when I call Value on the lazy value, then results are returned...

In a loop:
var query = session.Advanced.DocumentQuery<MyEntity, MyIndex>()
    .WhereEquals("Property", id)
    .AndAlso().WhereEquals("Value", value)
    .Lazily();

Is it possible to have lazy queries just for the purpose of calling Any?

Thanks

Oren Eini (Ayende Rahien)

unread,
Dec 12, 2017, 2:33:24 PM12/12/17
to ravendb
User LazilyCount() instead and then compare to 0 ?

Hibernating Rhinos Ltd  

Oren Eini l CEO 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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Nick

unread,
Dec 12, 2017, 2:50:47 PM12/12/17
to RavenDB - 2nd generation document database
Ah, CountLazily ! Missed this one. Thanks.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages