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

Document path with duplicate ID is returning error #89

Open
dzbrozek opened this issue Feb 15, 2021 · 2 comments
Open

Document path with duplicate ID is returning error #89

dzbrozek opened this issue Feb 15, 2021 · 2 comments

Comments

@dzbrozek
Copy link

When document path contains the same document ID multiple times useDocument is returning error.
Example:

users/2MrkMdgKuhJvgsT8GxoS38qDrWST/blocks/2MrkMdgKuhJvgsT8GxoS38qDrWST

is reduced to users/blocks by that line

let collection: string | string[] = path.split(`/${data.id}`)

and that results in the following error:

[fuego-swr-keys-from-collection-path] error: Passed a path that was not a collection to useCollection: users//blocks
@nandorojo
Copy link
Owner

nandorojo commented Feb 15, 2021

Interesting catch! Open to a PR if you could propose a solution.

Just curious, does it make sense for documents to have the same ID like that? I figure they should always be unique.

@dzbrozek
Copy link
Author

I guess they need to be unique withing single collection but sub-collection is just another collection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants