Try this query:

select expand(out("Sell").@rid) from Account where @rid=#25:0

Hope it helps.

Il giorno mercoledì 26 ottobre 2016 07:06:23 UTC+2, [email protected] ha 
scritto:
>
> Hello, I'm running OrientDB 2.2.12 on Mac/Linux
>
> I'm trying to perform a simple out() lookup from a class and get all 
> properties of another class. I can get all properties except @rid. I tried 
> different ways, but nothing seem to work or return the @rid. How do I get 
> the @rid as a property? Here is what I tried:
>
> My class: 
>
> orientdb {db=Customers}> info class SellCampaign
>
>
> CLASS 'SellCampaign'
>
> Records..............: 1
>
> Super classes........: [V]
>
> Default cluster......: sellcampaign (id=149)
>
> Supported clusters...: sellcampaign(149), sellcampaign_1(150), 
> sellcampaign_2(151), sellcampaign_3(152)
>
> Cluster selection....: round-robin
>
> Oversize.............: 0.0
>
>
> PROPERTIES
>
>
> +----+------------+----+-----------------+---------+--------+--------+----+----+-------+-------+
>
> |#   |NAME        |TYPE|LINKED-TYPE/CLASS|MANDATORY|READONLY|NOT-NULL|MIN 
> |MAX |COLLATE|DEFAULT|
>
>
> +----+------------+----+-----------------+---------+--------+--------+----+----+-------+-------+
>
> |0   |leadCategory|LINK|LeadCategory     |true     |false   |true    |   
>  |    |default|       |
>
>
> +----+------------+----+-----------------+---------+--------+--------+----+----+-------+-------+
>
> Here are the queries I tried:
>
> // returns only leadCategory property
> select expand(out('Sell')) from Account where @rid = #25:0
>
> // returns only leadCategory property
> select expand(out('Sell').include('@rid','leadCategory')) from Account 
> where @rid = #25:0
>
> // results in error
> select expand(out('Sell').include(@rid.asString(),'leadCategory')) from 
> Account where @rid = #25:0
>
> Error on execution of command: sql.select 
> expand(out('Sell').include(@rid.asString(),'leadCategory')) from Account 
> where @rid = #25:0
>     DB name="Customers"
>     DB name="Customers"
>
> If I simply run a select statement with @rid.asString() it works fine: 
> select @rid.asString(), leadCategory from SellCampaign
>
>
> How do I get the @rid of the class when I traverse to it?
>
> Please help.
>
>

-- 

--- 
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