ra0o0f / arangoclient.net

ArangoDB .NET Client with LINQ support
Apache License 2.0
99 stars 37 forks source link

Could you please check if InsertEdge is broken right now? #47

Closed chefhl closed 8 years ago

chefhl commented 8 years ago

Hello,

could you please check if InsertEdge is broken right now? I am very confident that I am using it right but it gives me the following error:

An unhandled exception of type 'ArangoDB.Client.ArangoServerException' occurred in ArangoDB.Client.dll

Additional information: unknown path '/_api/edge?collection=VoltageLevelOfSubstation&createCollection=True&waitForSync=False&from=VoltageLevel%2F4419f583-13f4-4577-b95e-09269e2c4e2f&to=Substation%2F1fc54ab8-85c1-42a3-8605-0bcf8ac3d09d'. ErrorNumber: 404 HttpStatusCode: 404

Note that I am using self-generated Guids as keys. All the "VoltageLevel" and "Substation" instances as well as all document and edge collections were successfully inserted before.

Sadly I couldn't find a test in the sources for InsertEdge to verify that it's basically working. Maybe you could add one.

Thanks in advance and best regards Patrick

ra0o0f commented 8 years ago

UPDATE: i tested it with ArangoDB 2.8(see below), it seems it breaks with 3.0 version. let me look in to it

@chefhl i inserted an edge with success in ArangoDB 2.8.1 and .net client 0.7.31 with the following code

db.CreateCollection("VoltageLevelOfSubstation", type: CollectionType.Edge);
db.CreateCollection("VoltageLevel");
db.CreateCollection("Substation");

db.EdgeCollection("VoltageLevelOfSubstation")
                    .InsertEdge(from: "VoltageLevel/F4419f583-13f4-4577-b95e-09269e2c4e2f",
                        to: "Substation/1fc54ab8-85c1-42a3-8605-0bcf8ac3d09d",
                        edgeDocument: new VoltageLevelOfSubstation  { Label = "connectes two vertices" });

public class VoltageLevelOfSubstation
{
    public string Label { get; set; }

    [DocumentProperty(Identifier = IdentifierType.EdgeFrom)]
    public string From { get; set; }

    [DocumentProperty(Identifier = IdentifierType.EdgeTo)]
    public string To { get; set; }
}

can you provide the insert code you are using and also ArangoDB, .Net client version?

ra0o0f commented 8 years ago

@chefhl ArangoDB 3.0 combines http api for create/read/update/delete documents and edges. so the client should be updated with the new api. i will do it until tomarrow

chefhl commented 8 years ago

I just started prototyping today so I'm on ArangoDB v3.0.0 and .net driver v0.7.31 Obviously that is the problem. Thanks for looking into this so quickly!

ra0o0f commented 8 years ago

@chefhl edges/graph changes to work with ArangoDB 3.0 may take longer(a week or so).

https://docs.arangodb.com/3.0/Manual/ReleaseNotes/UpgradingChanges30.html https://docs.arangodb.com/3.0/cookbook/AQL/MigratingGraphFunctionsTo3.html

i will inform you here when its done.

chefhl commented 8 years ago

Any update yet?

ra0o0f commented 8 years ago

@chefhl sorry but it will take longer than i thought. not sooner than a month. i'm revising all aspects of client.

ra0o0f commented 8 years ago

@chefhl client now support v3.0 version of ArangoDB, InsertEdge should work fine now. install the latest version from the nuget. sorry if it took long