diff --git a/gcloud/datastore/query.py b/gcloud/datastore/query.py index 9ae6790daca8..e7611f11247b 100644 --- a/gcloud/datastore/query.py +++ b/gcloud/datastore/query.py @@ -516,6 +516,14 @@ def projection(self, projection=None): clone._pb.projection.add().property.name = projection_name return clone + def keys(self): + """Adds a projection to get keys only + + :rtype: :class:`Query` + :returns: A new Query instance only returns entity keys + """ + return self.projection(['__key__']) + def offset(self, offset=None): """Adds offset to the query to allow pagination.