vinayakb | 38b7ca4 | 2012-03-05 05:44:15 +0000 | [diff] [blame] | 1 | drop dataverse events if exists; |
| 2 | create dataverse events; |
| 3 | use dataverse events; |
| 4 | |
| 5 | |
| 6 | create type AddressType as closed { |
| 7 | street: string, |
| 8 | city: string, |
| 9 | zip: string, |
| 10 | latlong: point |
| 11 | } |
| 12 | |
| 13 | create type UserType as open { |
| 14 | name: string, |
| 15 | email: string, |
| 16 | interests: {{string}}, |
| 17 | address: AddressType, |
| 18 | member_of: {{ |
| 19 | { |
| 20 | sig_name: string, |
| 21 | chapter_name: string, |
| 22 | member_since: date |
| 23 | } |
| 24 | }} |
| 25 | } |
| 26 | |
| 27 | |
| 28 | create nodegroup group1 if not exists on nc1, nc2; |
| 29 | |
ramangrover29 | 669d8f6 | 2013-02-11 06:03:32 +0000 | [diff] [blame] | 30 | create dataset User(UserType) primary key name on group1; |
vinayakb | 38b7ca4 | 2012-03-05 05:44:15 +0000 | [diff] [blame] | 31 | |
| 32 | write output to nc1:"/tmp/q1.adm"; |
| 33 | |
| 34 | for $user in dataset('User') |
| 35 | where some $i in $user.interests |
| 36 | satisfies $i = "movies" |
| 37 | return {"name": $user.name} |