code: function modifyDoc(collectionState, action) {
    if (!action.meta.subcollections || action.meta.storeAs) {
      return updateItemInArray(collectionState, action.meta.doc, item =>
        // Merge is used to prevent the removal of existing subcollections
        assignObjects(item, action.payload.data),
      );
    }
  
    // TODO: make this recurisve so it will work multiple subcollections deep
    const [, docId, subcollectionName, subDocId] = pathToArr(action.meta.path);
  
    // Update document item within top arra
    return updateItemInArray(collectionState, docId, item => ({
      ...item, // preserve document (only updating subcollection)
      [subcollectionName]: updateItemInArray(
        get(item, subcollectionName, []),
        subDocId,
        // Merge with existing subcollection doc (only updates changed keys)
        subitem => mergeObjects(subitem, action.payload.data),
      ),
    }));
  }
docs: Case reducer for modifying a document within a collection or
  subcollection. When storeAs is being used, subcollections are
  moved to the level of the storeAs (instead of on their parent doc).
  @param  {Array} [collectionState=[]] - Redux state of current collection
  @param  {Object} action - The action that was dispatched
  @return {Array} State with document modified