Feature (or pull) request!

56 views
Skip to first unread message

Nicolas Garfinkiel

unread,
May 11, 2012, 7:28:54 PM5/11/12
to rav...@googlegroups.com
Hey guys,

Is it possible to have something like QueryByKeyPrefix<T>(string keyPrefix)?

This is my case: I have lots and lots of entities that I just need to get as a list and I feel that it's a shame to have so many indexes that don't serve any purpose (and dunno if they can be an issue performance-wise).

I know there is StartsWith in DatabaseCommands, but it returns JsonDocuments and it would be nice to have the deserialized entity properly tracked and cached.

What do you think? Can you do it? Or would you like to have it pull-requested?

Cheers,
Nicolas.

Oren Eini (Ayende Rahien)

unread,
May 11, 2012, 7:33:31 PM5/11/12
to rav...@googlegroups.com
Take a look at build 93x, session.Advanced.LoadStartingWith()

Nicolas Garfinkiel

unread,
May 11, 2012, 8:07:51 PM5/11/12
to rav...@googlegroups.com
Great! Thanks for your reply!


On Friday, May 11, 2012 8:33:31 PM UTC-3, Oren Eini wrote:
Take a look at build 93x, session.Advanced.LoadStartingWith()

Nicolas Garfinkiel

unread,
May 15, 2012, 3:02:33 PM5/15/12
to rav...@googlegroups.com
Getting back on the subject... Is there any way to get the total records from the DB? Need it for paging purposes.

Cheers.

Troy

unread,
May 15, 2012, 4:46:46 PM5/15/12
to rav...@googlegroups.com

Nicolas Garfinkiel

unread,
May 15, 2012, 4:52:38 PM5/15/12
to rav...@googlegroups.com
Thanks Troy, but that would involve to hit an index.

What I'm looking for is to get the total records for the session.Advanced.LoadStartingWith()

Cheers.

On Tuesday, May 15, 2012 5:46:46 PM UTC-3, Troy wrote:
This should help:
 

Itamar Syn-Hershko

unread,
May 15, 2012, 5:20:53 PM5/15/12
to rav...@googlegroups.com
What's the problem with hitting the index?

A total number of documents is available to you via the /stats endpoint, for any further drill down you'll have to query an index if all you want is the count

Oren Eini (Ayende Rahien)

unread,
May 16, 2012, 5:42:49 AM5/16/12
to rav...@googlegroups.com
No, we don't know that number for starts with, actually. Figuring it out could be costly in large instances, so we don't do this.
Reply all
Reply to author
Forward
0 new messages