You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried, actually it needs GraphSONSerializersV2d0 instead of V3, I used grammes.WithGremlinVersion(2) for that, vertices are added, but retreival queries don't work, it returns empty labels and IDs. This is test code:
package main
import (
"fmt"
"log"
"github.com/northwesternmutual/grammes"
)
func main() {
cosmosdb_account := "g123"
cosmosdb_password := "J7q==" // Primary key from Keys
cosmosdb_database := "db" // In Data Explorer, need to create yours
cosmosdb_graph := "test" // In Data Explorer, need to create yours
cosmosdb_partition_key := "partition_key" // the same as you set when creating the graph in Data Explorer
cosmosdb_partition_value := "1"
host := "wss://" + cosmosdb_account + ".gremlin.cosmosdb.azure.com:443/"
username := "/dbs/" + cosmosdb_database + "/colls/" + cosmosdb_graph
password := cosmosdb_password
client, err := grammes.DialWithWebSocket(host,
grammes.WithAuthUserPass(username, password),
grammes.WithGremlinVersion(2),
)
if err != nil {
log.Fatal(err.Error())
}
_, err = client.AddVertex("test", cosmosdb_partition_key, cosmosdb_partition_value)
if err != nil {
log.Fatal("failed to add vertex", err.Error())
}
g := grammes.Traversal()
vertices, err := client.VerticesByQuery(g.V())
if err != nil {
log.Fatal("Couldn't gather vertices", err.Error())
}
for _, vertex := range vertices {
fmt.Println(vertex.Label(), vertex.ID())
}
}
The text was updated successfully, but these errors were encountered:
That's good that it works, but VerticesByQuery returns array of vertices already []model.Vertex, but ExecuteQuery returns raw result. This means you will unable to use the library API.
Hello, does this library support CosmosDB?
I tried, actually it needs GraphSONSerializersV2d0 instead of V3, I used grammes.WithGremlinVersion(2) for that, vertices are added, but retreival queries don't work, it returns empty labels and IDs. This is test code:
The text was updated successfully, but these errors were encountered: