Open mkorenko opened 4 years ago
Currently it is not possible to make queries for nested object fields:
class Comment extends Entity { ... @field({ name: 'by' }) by!: string; } @rootCollection({ name: 'posts' }) class Post extends Entity { ... @field({ name: 'pinnedComment' }) pinnedComment!: Comment; } ... Collection(Post).query().where('pinnedComment.by', '==', 'userId').get();
Error: error TS2345: Argument of type '"pinnedComment.by"' is not assignable to parameter of type '... | "by" | "ref" | "toData"'. The proposal is to optionally pass an array of properties as a path:
error TS2345: Argument of type '"pinnedComment.by"' is not assignable to parameter of type '... | "by" | "ref" | "toData"'.
Collection(Post).query().where(['pinnedComment', 'by'], '==', 'userId').get();
Currently it is not possible to make queries for nested object fields:
Error:
error TS2345: Argument of type '"pinnedComment.by"' is not assignable to parameter of type '... | "by" | "ref" | "toData"'.
The proposal is to optionally pass an array of properties as a path: