googleapis / googleapis/google-cloud-java

[java-firestore] whereHavingExample sample throws error

Đang mở
#13,093 1 bình luận 0 reaction 1 người được giao Được @morganchen12 nhận Xem trên GitHub
api: firestore samples
Ngôn ngữ chính
Java
Star
2.1k
Fork
1.2k
Merge trung bình
1 ngày 23 giờ
Pull request đã merge (30 ngày)
154

Mô tả

https://github.com/googleapis/java-firestore/blob/be110eedb85ea5e83740057a7771ddb238dfa64d/samples/preview-snippets/src/main/java/com/example/firestore/PipelineSnippets.java#L1823-L1837

throws error

```java
Caused by: io.grpc.StatusRuntimeException: INVALID_ARGUMENT: The nested field reference 'location.state' is not supported in its current use case.

Certain stages like `aggregate(...)` or `unnest(...)` only support assigning to top-level fields. This means you cannot use an alias like 'foo.bar' to assign the result to a nested field. If you want to use an alias that has a dot in it, escape the path with backticks, like `foo.bar`.

Depending on the SDK, this can be done like so:`.distinct(field("address.city").as("`address.city`"))`
at io.grpc.Status.asRuntimeException(Status.java:532)
```

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.