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

Firebase v9 create collection refference from collection refference path order error #5431

Closed
niklv opened this issue Sep 2, 2021 · 1 comment · Fixed by #5440
Closed
Assignees

Comments

@niklv
Copy link

niklv commented Sep 2, 2021

Environment

  • Operating System version: macOS
  • Browser version: Firefox v91
  • Firebase SDK version: v9.0.1
  • Firebase Product: firestore

Problem

Looks like there are an error in firebase collection method.
I try to create collection refference from collection reference and get unxpected path elements order.

Relevant Code:

import { getFirestore, collection } from 'firebase/firestore'

const artistsRef = collection(getFirestore(), '/events/some_event_id/artists')
const artistSongsRef = collection(artistsRef, 'some_artist_id', 'songs')

console.log(artistsRef.path) // events/some_event_id/artists
console.log(artistSongsRef.path) // events/some_event_id/artists/songs/some_artist_id <- ERROR it should be events/some_event_id/artists/some_artist_id/songs

I think this code cause problem https://github.com/firebase/firebase-js-sdk/blob/master/packages/firestore/src/lite-api/reference.ts#L390

@ehsannas
Copy link
Contributor

ehsannas commented Sep 2, 2021

Thanks for reporting @niklv . We'll investigate this shortly.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
4 participants