使用OrientDB 2. *和OrientSQL。
我有一个简单的图表与类Users有许多属性(用户名,国家,宠物等)。 每个用户也有外向friends优势。 我想只选择与特定用户成为朋友的所有用户的username和country 。
我的查询到目前为止:
SELECT EXPAND( BOTH('friends') ) FROM users WHERE @rid = #12:0为#12:0朋友返回完整的用户对象
我只想返回这些朋友的username和country 。
我错过了一些简单的事吗? 非常感激!
Using OrientDB 2.* with OrientSQL.
I have a simple graph with Class Users that has a number of properties (username, country, pets, etc). Each user also has outgoing friends edge. I want to select only the username and country from all users who are friends with a specific user.
My query so far:
SELECT EXPAND( BOTH('friends') ) FROM users WHERE @rid = #12:0returns the full user objects for those who are friends of #12:0
I want only to return the username and country of those friends.
Am I missing something simple? Much appreciated!
最满意答案
您可以:
select expand(both('friends').include('username', 'country')) from #12:0请注意,您应该:
select from #12:0代替:
select from Users where @rid = #12:0You can:
select expand(both('friends').include('username', 'country')) from #12:0Note that you should:
select from #12:0instead of:
select from Users where @rid = #12:0更多推荐
发布评论