Skip to content

Commit

Permalink
fix: remove __name__ from generated fields
Browse files Browse the repository at this point in the history
  • Loading branch information
ericvera committed Aug 30, 2024
1 parent d35cfd1 commit 41089d5
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/getIndexFromReport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,16 @@ export const getIndexFromReport = (
process.exit(1)
}

const fields = index.fields.map(({ fieldPath, order }) => ({
fieldPath,
order,
}))
const fields = index.fields
// Apparently the __name__ field is included regardless of it being included in the index file.
// Ref: https://cloud.google.com/firestore/docs/reference/rest/v1/projects.databases.collectionGroups.indexes
// One problem is that when it is included the deployment will fail.
// Ref: https://github.com/firebase/firebase-tools/issues/1483
.filter(({ fieldPath }) => fieldPath !== '__name__')
.map(({ fieldPath, order }) => ({
fieldPath,
order,
}))

const collectionGroup = getCollectionGroup(index.name)

Expand Down

0 comments on commit 41089d5

Please sign in to comment.