-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
query filter on nested property value. #222
Comments
Hi @jeffj6123, sorry for the late answer! Do you have an example on the Google doc (https://googleapis.dev/nodejs/datastore/latest/index.html) where it filters by an Array item and then property of the object? So I can understand better what you are trying to do. |
Hey, |
Hey I wondered if there are any updates here? |
Hello, sorry for the late answer. I don't have the bandwidth to work currently on the project but there is a new maintainer who will be taking the lead shortly. I am going to label this issue as In the short term, if by adding |
Hey, @jeffj6123 |
Is there a proper way to query on a nested property like this example below.
`
interface KeyValue {
key: string;
value: string;
}
interface KeyValueContainer {
container: KeyValue[];
}
// Pass it on Schema creation
const schema = new Schema({
container: { type: Array, optional: false },
});
const Kvc = gstore.model('KVC', schema);
Kvc.query().filter("container.key", "=", "test");
`
At the last line I get
Argument of type '"container.key"' is not assignable to parameter of type '"container"'.ts(2345)
it looks like the filter only accepts the top level properties.
Is there a way to handle this query in gstore-node or do I need to drop down to the base google cloud library?
Like I can drop <any> in front of the "container.key" string to remove the error but that feels like a weak solution.
The text was updated successfully, but these errors were encountered: