8000 Firestore: Include a trailing /documents on root resource paths by mikelehen · Pull Request #4352 · googleapis/google-cloud-java · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ boolean areTimestampsInSnapshotsEnabled() {

/** Returns the name of the Firestore project associated with this client. */
String getDatabaseName() {
return databasePath.toString();
return databasePath.getDatabaseName().toString();
}

/** Returns the underlying RPC client. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,8 @@ String getPath() {
*/
String getName() {
String path = getPath();

if (path.isEmpty()) {
return getDatabaseName().toString();
return getDatabaseName() + "/documents";
} else {
return getDatabaseName() + "/documents/" + getPath();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ public static RunQueryRequest query(StructuredQuery... query) {
public static RunQueryRequest query(
@Nullable ByteString transactionId, StructuredQuery... query) {
RunQueryRequest.Builder request = RunQueryRequest.newBuilder();
request.setParent(LocalFirestoreHelper.DATABASE_NAME);
request.setParent(LocalFirestoreHelper.DATABASE_NAME + "/documents");
StructuredQuery.Builder structuredQuery = request.getStructuredQueryBuilder();
structuredQuery.addFrom(
StructuredQuery.CollectionSelector.newBuilder().setCollectionId("coll"));
Expand Down
0