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

rebindings map #4

Open
mandolyte opened this issue Sep 23, 2016 · 3 comments
Open

rebindings map #4

mandolyte opened this issue Sep 23, 2016 · 3 comments

Comments

@mandolyte
Copy link

I have found that some gremlin server implementations, DSE Graph in particular, require aliases to be provided. This is discussed here, but there is no indication of what the key/value pair look like.

Could you update the documentation to explain how this should be handled?

@rushmorem
Copy link
Contributor

I'm not up to date with the developments in Tinkerpop at the moment. Thanks for the heads up. Will look into it.

@mandolyte
Copy link
Author

While not about your package, this thread has some details and a solution for a different package:
https://groups.google.com/forum/#!topic/gremlin-users/sjlzWPBJZ0k

@rushmorem
Copy link
Contributor

Well, go-gremlin fully exposes the request object to you (including its request args which include the rebindings map) before it's submitted to the server. It's very easy to customise however you want. Query returns that object and Exec is called on it so here is how you can go about it:-

// Create a new request
req := gremlin.Query(`g.V()`)
// Populate the rebindings map
req.Args.Rebindings = gremlin.Bind{
  "g": "demo.g",
}
// Process the request
data, err := req.Exec()

Note that Query is merely a factory for creating a request. It's totally optional. You can create your own request by hand if you want and call Exec on it.

oubiwann pushed a commit to MediaMath/gremlin that referenced this issue Jan 9, 2020
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