Query over Edge
Hi, may be I have not understand it right, but I can't se any way to query by query builder over an Edge.
My Graph are: I have Stores (V) and Postzips (V). Both are connected by an Edge (Store-->responsible_for-->Postzip). The query I use in Orient Studio to get a specific Store by Postzip is:
select Name, Id from Store where Out("responsible_for") contains (Value = "13189")
Is it possible to build this query by query builder? Or have I generally an failure in my query?
Thx for helping me
Hi @jfellien try this. In Orient Studio there is no query builder.
SELECT Name, Id FROM ( TRAVERSE OUT('responsible_for') FROM Store ) WHERE contains (Value = '13189')
Please specifiy what types are you using. Here you can see the syntax how to apply the contains command. http://orientdb.com/docs/2.0/orientdb.wiki/SQL-Where.html
Hi @StarpTech, oh sorry, I meant the query builder of orientjs :)
With this query builder I want to select the values. But when I look at your statement, may be I can use the syntax:
db.traverse().from('Store').where({Value: '13189'}).all()
.then(function (records) {
console.log('found records', records);
});
Is this right?
hi @jfellien
is the property "Value" stored in PostZip right?
Yes it is a property of PostZip.
You should start from PostZip in this case
select expand(in('responsible_for')) from PostZip where (Value = "13189")