I wish to filter documents based on a list which contains userId's these userId's are fields in the documents I wish to access. this question is similar but instead of a list of document references I have a list of field items.
Currently all I have is a display of all the documents in the collection:
Query posts = db.collection("posts");
FirestoreRecyclerOptions<Post> options = new FirestoreRecyclerOptions.Builder<Post>()
.setQuery(posts, Post.class)
.build();
adapter = new FirestoreRecyclerAdapter<Post, PostViewHolder>(options) {
@Override
protected void onBindViewHolder(@NonNull PostViewHolder postViewHolder, int position, @NonNull Post post) {
postViewHolder.setPost(post);
}
@NonNull
@Override
public PostViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext())
.inflate(R.layout.card_view_layout, parent, false);
return new PostViewHolder(view);
}
};
recyclerView.setAdapter(adapter);
I want the output to be all posts with a field userId that is contained in the List.
In other words, I know that I can query all documents with a specific field but can I query all documents that fit a a list of fields?