Use objects after partial doc retrieval #6

Closed
diegok opened this Issue Aug 9, 2012 · 0 comments

Projects

None yet

2 participants

Collaborator
diegok commented Aug 9, 2012

Would be nice to be able to select which fields to retrieve and then be able to use the object without the need of a full 'get'. It can probably work in some way of "read only" mode, just retrieve full object when trying to write on it or more fine grained like when trying to access a not full retrieved field. On my planned usage I will never write back as this is for search results only, so setting it as read only and raise exception when trying to use other way is fine for me.

Another approach can be to let the class define a constructor that will be in charge of parsing partial result... but automatic functioning is much better and probably doable as it's always the same.

Of course, required attributes should have default values if you plan to selectively not retrieve one of those.

One problem I see is when selecting partial data from a hash returned data is in dot notation, so it should be converted back to a hash before inflation on partial objects.

I see this feature very interesting for online search over docs that can have lot of data with the only purpose of searching/filtering.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment