这是indexloc提供的服务,不要输入任何密码
Skip to content

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

@niklv

Description

@niklv

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions