extendCollection = (collection, options) => {
  const newOptions = mergeWith({}, collection.options, options, (a, b) => {
    if (Array.isArray(a) && Array.isArray(b)) {
      return a.concat(b);
    }
    if (Array.isArray(a) && b) {
      return a.concat([b]);
    }
    if (Array.isArray(b) && a) {
      return b.concat([a]);
    }
  });
  collection = createCollection(newOptions);
  return collection;
}
@summary Allow mongodb aggregation
@param {Array} pipelines mongodb pipeline
@param {Object} options mongodb option object