score:2

Your JS code looks like you're trying to use Realtime Database query methods on Firestore. I'd expect it to look more like:

export const getSprintByProjectId = (key) => async (dispatch) => {
  console.log(key);
  try {
    dispatch(loaderOn());
    const result = await db
      .collection("sprints")
      .where("projectId", "==", key)
      .get();
    console.log(result.docs.map(d => d.data());
  } catch (error) {
    dispatch(errorOn());
  } finally {
    dispatch(loaderOff());
  }
};

Related Query

More Query from same tag