Skip to content

Figure out an elegant way to speify views #13

robertkeizer opened this Issue Aug 12, 2013 · 4 comments

1 participant

ArgyleMachine member

As of #12 a basic view per class will be done.

There should be an elegant way to define views, such that not every combination of every attribute is its own view.

@robertkeizer robertkeizer was assigned Aug 12, 2013
ArgyleMachine member

May have to resort to a default of massive view ( bottom of the page ).

ArgyleMachine member

Other alternative is more complex, but would be more efficient at higher document count:

Multiple views, one for each attribute, with the key being [ name_of_class, name_of_attribute, value_of_attribute ]. And the value being the document ID.

ArgyleMachine member

Using the following so far.

function(doc) {
  if( doc["+name"] && doc["+name"] == 'Person' ){
    for( var attr in doc ){
      if( attr != "+name" && attr.charAt( 0 ) != "_" ){
        emit( [ attr, doc[attr] ], null );

That yields something similar to:

ArgyleMachine member

Something to think about: complex values of attributes.. if that will still work in an elegant fashion. Should, but worth noting in this issue to think about more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.