The following query does not work as I would expect it to, so I'm looking 
for some better understanding:

SELECT FROM doctors
WHERE (out = #13:6456) AND (SELECT COUNT(*) FROM documents WHERE 
($parent.current.in = out)) > 0
LIMIT 1



doctors is an Edge, as it documents joined by a Vertex between them.

[A]---doctors--->[B]---documents--->[C]


The query is simply looking to return all doctors which come out from A where 
the Count of connected documents through any vertex B is greater than 0.

The syntax is accepted by the parser, but it never results in any edges 
being returned, even though I know the data exists.  

I also know that the query can be rewritten to produce the results I am 
looking for (here's an example that works: SELECT 
expand(out('doctors').out('documents').in().inE()) FROM #13:6456 ), but 
that's not what I'm looking for.  

I'd like to know why the query above does not work.

I'm writing a C# LINQ provider, and I need to use fairly naive methods for 
creating queries, like the one shown above, but I'm struggling to 
understand how I can "join" subquery expressions as illustrated above.

Here's an example of the C# LINQ syntax, as a reference that produces the 
top query:

  var doctors = repo.doctors.Where(
                doctorE =>
                doctorE.Source == source
                && repo.documents.Where(documentE => doctorE.Target == 
documentE.Source).Count() > 0)
                .First();


Thanks!

Bill 

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to