tumblr / collins

groovy kind of love
tumblr.github.com/collins
Apache License 2.0
572 stars 99 forks source link

Document cql for nested information #544

Open michaeljs1990 opened 7 years ago

michaeljs1990 commented 7 years ago

Not sure what the correct title for this would be but in my case the data I am trying to run a query against is

"CLASSIFICATION"=>{"ID"=>8535, "TAG"=>"compute_mcx2", "STATE"=>nil, "STATUS"=>"Incomplete", "TYPE"=>"CONFIGURATION", "CREATED"=>"2017-04-03T20:30:26", "UPDATED"=>"2017-04-03T20:31:11", "DELETED"=>nil}

where I want all classifications where the tag is compute_mcx2. I haven't yet been able to figure out the voodoo for this or possibly it just can't be done.

If this can be done I will document this if it can't are people open to adding support for it in the form of CLASSIFICATION.TAG=compute_mcx2 or something like that?

michaeljs1990 commented 7 years ago

It seems like https://tumblr.github.io/collins/recipes.html#collins_shell-console should be able to do what I want actually however running the commands in the example I get

collins /PRIMARY_ROLE > ls
       fatal  command failed
   exception  Error processing request: Asset with tag 'PRIMARY_ROLE' does not exist
********************************************************************************
     details  
      Response Code: 404
      URI: /api/asset/PRIMARY_ROLE

Does this happen on your install?

defect commented 7 years ago

Oh, wow. I haven't used collins-shell in a long time :) It does see to work for me though. Ruby 2.2.0 with collins_shell 0.2.23:

collins / > cd PRIMARY_ROLE
Found tag: 'PRIMARY_ROLE'
/PRIMARY_ROLE
collins /PRIMARY_ROLE > ls
[various primary roles]
michaeljs1990 commented 7 years ago

hmm exact same setup :( i'll have to dig into that later see what I borked.

byxorna commented 7 years ago

@michaeljs1990 are you testing on a new collins instance, with no meta keys "PRIMARY_ROLE"? i think thats what would cause this...