I am building a chat room engine and I have a graph like so:
User---Started--->Room----Discuss--->Item<---Own---User
I would like to get all the Items and the roomId associated to the Item for a particular User.
select
*, in('Discuss').in('Started')[name ='julie'] as roomId
from item
so this is going threw the right 'Room' and finds the one started by 'Julie' but it returns Julie's Id, how do I get with this query the Id of that room ? It's like i need to do a 'one back' and get @rid...
I am new to graphs so any pointers would be appreciated.
--
---
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 orient-databa...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
select
*, in('Discuss').in('Started')[name ='julie'].out('Started') as roomId
from item
select *, in('Discuss').@rid as roomId from (select expand(out('Started').out('Discuss')) from User where name = 'julie')
select *, in('Discuss')[in('Started')[name='julie']].@rid as roomId from Item
select
*, in('Discuss').in('Started')[name ='julie'].out('Started') as roomId
from item
select
*, in('Discuss')[in_Started.in.name ='julie'] as roomId
from item
select
in('Discuss').in_Started.out.name as roomId
from item
select
in('Discuss')[in_Started.out.name[0][0] = 'julie'] as roomId
from item
select
in('Discuss')[in_Started.out.name = 'julie'] as roomId
from item
Thanks for your help alessand...@gmail.com but I am still struggling for the solution... The issues with your proposal is:
1. I get the roomIds for Item 13:54 of marc and julie.
2. I would like to get all the Items not only the ones that have a room starter by julie
Context:
This is the Initial loading data of a product selling site, I need to load all the items and I would like to have the roomId for the item where the user logged-in has 'started' a room.
here is a link to a StackOverflow for the same issue... query-on-orientdb-graph
Hi Brett,
if I understand the problem, try this query
select name , in('Discuss').in('Started').out('Started')[roomId] from Item
Bye, Alessandro