1

Firestore collection for office doc like this

{
 officeId: 'OF005'
 userIds:[
   "U001",
   "U002",
   "U003",
   "U004",
   "U005"
 ]
},
{
 officeId: 'OF005'
 userIds:[
   "U006",
   "U007",
   "U008",
   "U009",
 ]
}

In react native app, I connect firestore like this

    firestoreConnect(props => [
    { collection: 'office',
      where: ['userIds', '==', props.id],
    },
  ]),

and prop.id is the id of user I want to get all offices he works

or I want to search by office id some thing like this

firestoreConnect(props => [
    { collection: 'office',
      where: ['officeId', '==', ["OF001", "OF003", "OF004"]],
    },
  ]),

can i do this.

1

1 Answer 1

1

You will need to use a Map of Values. Take a look at Working with Arrays, Lists, and Sets

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.