Gremlinq / ExRam.Gremlinq

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

_gremlinQuerySource.V<V1>().Where(filter).ToArrayAsync() fails when the record exists & How to get Gremlin script correctly from .Debug()

DocGreenRob opened this issue · comments

Describe the bug
I am trying to use the call await _gremlinQuerySource.V<V1>().Where(filter).ToArrayAsync();. Sometimes it works, sometimes it doesn't. It is inconsistent.

filter is a Expression<Func<V1, bool>>.

I'm simply looking for a name (i.e., "Customer - (test #123)")

This is how I'm calling this method:

await _unitOfWork.CustomerRepository.GetVertexAsync(x => x.name == customer.name);

so, filter is x => x.name == customer.name

... it doesn't error, it just returns [0] when there is a record there.

The query I use in the graph (Cosmos Gremlin Db) g.V().hasLabel('Branch').has('name', containing('(test #')). Would be nice if you can also tell me how to generate this specifically.

But I still want eyes on my issue. I'd like to be able to query the Db using the filter expression.

This led me to wanting to debug the issue.

So, I then tried:

var a = _gremlinQuerySource.V<V1>().Where(filter).Debug();

but this returns:

image

and not the actual gremlinq script itself. Can you help with this too?

Expected behavior
I expect to get the data from the graph but instead I get nothing.

Version information

<PackageReference Include="ExRam.Gremlinq.Providers.Core" Version="10.0.0" />
<PackageReference Include="ExRam.Gremlinq.Providers.CosmosDb" Version="10.0.0" />
<PackageReference Include="Gremlin.Net" Version="3.6.1" />

Sample
I'm at work, for a corporate client. Trying to implement your technology. I don't have the time to breakdown and build up a sample. If it is a really really must, I guess so... IDK how/when... but I can tell you I am blocked... Major corporation, trying to get Exram into Production!

We are in UAT and a particular feature needs my code to work. Of course I can just write the script (ugly Cosmos Gremlin Code) itself and be done in 30 minutes but that will kill my case for Exram. (which I currently have in many services for my team)

Your guys call... (hope you guys can help me/us)

So, you guys actually have a bug, maybe you can use your code to verify.

But, when the filter is x => x.name == "Customer - (test#123)" it fails.
But, if I say filter is x => x.accountNumber == "12345" it works.

So, if you can please answer the Debug() question. But there is defintely a bug here if the string has ( or ) or #. One of those is breaking your .Where(..):

TSelf Where(Expression<Func<TElement, bool>> predicate);

located: ExRam.Gremlinq.Core
#region Assembly ExRam.Gremlinq.Core, Version=10.0.0.0, Culture=neutral, PublicKeyToken=null

commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.