Gremlinq / ExRam.Gremlinq

A .NET object-graph-mapper for Apache TinkerPop™ Gremlin enabled databases.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Case issue

smolesen opened this issue · comments

Not really sure if this is a issue, or some configuration I'm missing
Having an existing graph in CosmosDB, with the following Vertex:

{
    "id": "9a5a02f3-54ef-4b02-ad0b-8c3bff197a60",
    "label": "folder",
    "properties": {
      "name": [
        {
           "value": "Folder1"
        }
      ]
}

and a model:

    public class Vertex :  IVertex
    {
        public object Id { get; set; }
        public string Label { get; set; }
        public VertexProperty<string, NameMeta> Name { get; set; }
    }

If I query:

_g.V("9a5a02f3-54ef-4b02-ad0b-8c3bff197a60")

it nicely maps lowercase 'name' to uppercase 'Name', but if I adda 'Where' clause on Name:

_g.V("9a5a02f3-54ef-4b02-ad0b-8c3bff197a60").where(v => v.Name == "Folder1")

then I don't get anything.... turns out that query executed is:

g('9a5a02f3-54ef-4b02-ad0b-8c3bff197a60').has('Name', 'Folder1') <--- with uppercase name

Tried to add a jsonproperty:

[JsonProperty("name")]

but it doesn't make any change.

Is there a way to make it work, or do I have to use same casing in my models as in the DB?
TIA
Søren

Check out this way to configure the element model, then use ConfigureModel on the GremlinQuerySource to get to that configuration. Should work for cases like this.

Great, solved my problem..

Thanks
/Søren