Skip to content

how to populate an array #314

Open
Open
@sarmong

Description

I have a collection groups, inside which there is an array students with each item being a reference to a document in another collection - students.

I am doing this

const populates = [
  { child: 'students', root: 'students' }
]
const enhance = compose(
  firestoreConnect([
    { collection: 'groups', populates }
  ]),
  connect(
    ({ firestore }) => ({
      groups: populate(firestore, 'groups', populates),
    })
  )  
)

I get this error

Uncaught FirebaseError: Function CollectionReference.doc() requires its first argument to be of type non-empty string, but it was: a custom n object

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions