-
Notifications
You must be signed in to change notification settings - Fork 156
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
Does rueidis support MULTI/EXEC in redisgraph? #43
Comments
Hi @ebrahimtorabi, Yes, It supports it. Here is an example: package main
import (
"context"
"fmt"
"github.com/rueian/rueidis"
)
func main() {
c, err := rueidis.NewClient(rueidis.ClientOption{
InitAddress: []string{"127.0.0.1:6379"},
})
if err != nil {
panic(err)
}
defer c.Close()
ctx := context.Background()
if err := c.Dedicated(func(client rueidis.DedicatedClient) error {
prepares := rueidis.Commands{
client.B().Multi().Build(),
client.B().Del().Key("movies").Build(),
client.B().GraphQuery().Graph("movies").Query("CREATE (:Actor {name:'Mark Hamill', actor_id:1}), (:Actor {name:'Harrison Ford', actor_id:2}), (:Actor {name:'Carrie Fisher', actor_id:3})").Build(),
client.B().GraphQuery().Graph("movies").Query("CREATE (:Movie {title:'Star Wars: Episode V - The Empire Strikes Back', release_year: 1980 , movie_id:1})").Build(),
client.B().Exec().Build(),
}
return client.DoMulti(ctx, prepares...)[len(prepares)-1].Error()
}); err != nil {
panic(err)
}
resp, err := c.Do(ctx, c.B().GraphQuery().Graph("movies").Query("MATCH (m:Movie) WHERE m.movie_id = 1 RETURN m").Build()).ToArray()
if err != nil {
panic(err)
}
nodes, err := resp[1].ToArray()
if err != nil {
panic(err)
}
for _, node := range nodes {
fmt.Println(node.ToAny())
}
} |
thanks for your reply |
I am going to close this issue. Feel free to reopen or open another issue if you need further help. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Does rueidis support MULTI/EXEC in redisgraph?
if yes please give me a example
The text was updated successfully, but these errors were encountered: