4
votes

Say I have a User entity with an embedded entity address which contains a house number property and a street property. How can I write a GQL projection query that will filter based on name and return a list of addresses ?

Sample Data: Sample Data

The projection query I am trying to write:

SELECT address FROM User WHERE name = Bob

This should return two addresses but it returns no results.

Thanks to anyone who answers !

1

1 Answers

3
votes

You can't project the entire entity value, but you can project the individual properties in the entity value, e.g.:

SELECT address.houseNumber FROM User WHERE name = Bob