Skip to content
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

Export firestore indexes in alphabetical order #1023

Closed
compojoom opened this issue Nov 19, 2018 · 4 comments
Closed

Export firestore indexes in alphabetical order #1023

compojoom opened this issue Nov 19, 2018 · 4 comments
Assignees
Labels
api: firestore polish Small feature requests

Comments

@compojoom
Copy link

@samtstern asked me to post this here, so here I am following orders :)

We have a production and dev. project. We keep our rules in git repository. I was hoping to be able to sync the rules by doing
firebase firestore:indexex > firestore.indexes.json

then compare the changes, approve and deploy.

However when I export the rules they seem to be ordered by I don't know what. Maybe the creation time of each rule. So I end up with a json file that is impossible to compare.

Is it possible to sort the rules alphabetically based on the collection name and then on the fieldPath - I'm not sure if the ordering in the field path is important, but if it is, then sorting only on collection name should do it.

@samtstern samtstern self-assigned this Nov 19, 2018
@samtstern
Copy link
Contributor

I'll probably add this as part of #1014 (once we get that API locked down)

@samtstern samtstern changed the title export firestore rules in alphabetical order Export firestore indexes in alphabetical order Nov 27, 2018
@samtstern
Copy link
Contributor

Changed the title of this issue to reflect that it's talking about indexes not rules

@samtstern
Copy link
Contributor

I did not do this in #1014 but it should be much easier now, since it's just creating a sorting algorithm for the index spec objet.

@laurenzlong laurenzlong added polish Small feature requests api: firestore labels Jan 9, 2019
@samtstern
Copy link
Contributor

Specifically we want to be able to sort the Index object here:
https://github.com/firebase/firebase-tools/blob/master/src/firestore/indexes-spec.ts#L6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: firestore polish Small feature requests
Projects
None yet
Development

No branches or pull requests

3 participants