Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

what is the index name when I create a schema index? #213

Open
angelacode opened this issue Nov 12, 2016 · 2 comments
Open

what is the index name when I create a schema index? #213

angelacode opened this issue Nov 12, 2016 · 2 comments

Comments

@angelacode
Copy link

angelacode commented Nov 12, 2016

I used the following:

# https://github.com/maxdemarzi/neography/wiki/Schema-indexes
@neo.create_schema_index('Client','bot_client_id')

Where 'Client' is the label and 'bot_client_id" is the key for the index.

But when I want to search on an indexed value, I am required to specify the index.

@neo.get_node_index(index, key, value)

But when I use the get_index I get an array of hashes with no value specified for index:

@neo.get_schema_index('Client') 
 => [{"property_keys"=>["bot_client_id"], "label"=>"Client"}] 

But what is the index? Or more directly, how can I get the node where bot_client_id is the indexed value by specifying that key and a specific value?

@maxdemarzi
Copy link
Owner

I'm sorry that isn't clear. It should be the label name, but using this method:

@neo.find_nodes_labeled("Actor", {:name => "Tom Hanks"}) # Find all the "Actors" named "Tom Hanks"

Or in your case @neo.find_nodes_labeled("Client",{:bot_client_id=> 1234})

@angelacode
Copy link
Author

Thanks -- I figured that might be the case afterwards, but wasn't sure. Thanks, now I can rest easy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants