select *, out('Owns').mail as emails, out('Owns').@rid as rid from User
If you click on RAW this return some like this:
{ "result": [ { "@type": "d", "@rid": "#12:0", "@version": 2, "@class": "User", "name": "Giulia", "out_Owns": [ "#14:0" ], "emails": [ ], "rid": [ "#13:0" ], "@fieldTypes": "out_Owns=g,rid=z" }, { "@type": "d", "@rid": "#12:1", "@version": 2, "@class": "User", "name": "Alessandro", "out_Owns": [ "#14:1" ], "emails": [ ], "rid": [ "#13:1" ], "@fieldTypes": "out_Owns=g,rid=z" }, { "@type": "d", "@rid": "#12:2", "@version": 2, "@class": "User", "name": "Luigi", "out_Owns": [ "#14:2" ], "emails": [ ], "rid": [ "#13:2" ], "@fieldTypes": "out_Owns=g,rid=z" } ], "notification": "Query executed in 0.016 sec. Returned 3 record(s)"}
Regards,
Giulia
Hi,
when you execute this query in the browse in Visual Studio
select *, out('Owns').mail as emails, out('Owns').@rid as rid from User
--
---
You received this message because you are subscribed to a topic in the Google Groups "OrientDB" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/orient-database/XgM8ccwkD1g/unsubscribe.
To unsubscribe from this group and all its topics, send an email to orient-databa...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
select *, out('Owns').include('mail','isSubscriber') as Email from User
"result": [ { "@type": "d", "@rid": "#12:0",
"@version": 3,
"@class": "User", "name": "Giulia", "out_Owns": [ "#14:0" ],
"isMale": false, "Email": [ { "@type": "d", "@version": 0, "mail": "g...@gmail.com", "isSubscriber": true } ], "@fieldTypes": "out_Owns=g,Email=z" }
]
Hi Charles,
the only way I've found to do what you asked is the following:
select *, out('Owns').include('mail','isSubscriber') as Email from User
This query also returns a number of other fields that are required (e.g. "@type": "d", "@rid": "#12:0", "@version": 3, "@class": "User",) and can not be excluded from the JSON file.
I hope you will be fine anyway.
Regards,Giulia