Repository navigation
Datastore querying by multiple kinds supported in gcloud-node, but not by Datastore. #572
Description
Activity
- addedtype: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.api: datastoreIssues related to the Datastore API.Issues related to the Datastore API.
on May 9, 2015 FYI there is kindless ancestor queries:
https://cloud.google.com/datastore/docs/concepts/queries#Datastore_Kindless_ancestor_queriesYes, you can provide 0 or 1 Kinds, but not N.
Agreed, this should be addressed.
OK so the question then becomes, how do we sort this out? Some options:
- Change
dataset.createQuery()to accept only one kind as a string - Change
dataset.createQuery()to still accept a list (or a string), but raise an exception if the list is more than one item long - Change
dataset.runQuery()to raise an exception if multiple kinds are there - Change
dataset.runQuery()to recognize the "multiple kinds not supported" error response and raise a more helpful error.
@GoogleCloudPlatform/cloud-datastore : Is there any chance at all that Datastore will support queries of multiple kinds (not Kindless queries, but queries for Kind1, Kind2, ..., KindN) ?
If the answer above is yes, we should probably go with the option that recognizes the error and raises it in a friendly way rather than trying to prevent people from doing this in client code.
- Change
Yes there is a plan to support queries on multiple kinds in the future, but I don't believe it is on our short-term roadmap.
Strange that the API is
kindsthat accepts an array of objects with{ name: 'kind' }. Our code will remain the exact same but the documentation will change. They may provide an array of 1 kind and that will work still but it won't be documented as such.Do you mean it's strange that it's an array of objects and not strings? If so, it's so we can support aliases (important if you want to select from the same kind multiple times).
I meant it's just strange that it accepts an array, and the property is
kindsas opposed tokind(singular) which would more suggest that it only accepts one.It is that way to potentially support queries like "SELECT * FROM Kind1 as
A, Kind1 as B, Kind2 WHERE A.b = B.a AND Kind2.b = A.b" in the future.On Sun, May 17, 2015 at 10:51 AM Ryan Seys [email protected] wrote:
I meant it's just strange that it accepts an array, and the property is
kinds as opposed to kind (singular) which would more suggest that it only
accepts one.—
Reply to this email directly or view it on GitHub
#572 (comment)
.- added a commit that references this issue
on Aug 22, 2022 14 remaining items
- added a commit that references this issue
on Jan 25, 2023 - added a commit that references this issue
on Jul 23, 2025 - added a commit that references this issue
on Feb 5, 2026 - added a commit that references this issue
on Feb 23, 2026 - added a commit that references this issue
on Feb 26, 2026 - added a commit that references this issue
on Mar 18, 2026
When running the following code:
I get the following error returned:
message: 'multiple kinds not supported'According to https://cloud.google.com/datastore/docs/concepts/queries, Datastore allows querying over a single kind, not multiple.
Maybe we should remove the ability to construct a query with multiple kinds?