Hi, I'm not sure I got the point, could you please post a script to create a DB and reproduce the problem? By default, the expand() function returns the full record, so that should be enough for what you need.
Thanks Luigi 2016-10-26 7:46 GMT+02:00 <[email protected]>: > Unfortunately it didn't work. > > Also, I need to return all properties, not just @rid. And to make things > more complicated this is a simple query, but the other one I have is > chaining more in(), out() to get to nodes about 3 levels deep. The queries > work, but the final vertex must return all properties and @rid must be > there. > > > > > On Tuesday, October 25, 2016 at 10:37:30 PM UTC-7, Oleksandr Gubchenko > wrote: >> >> 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. > -- --- 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.
