function isArrayFilter(piece) {
  return piece.startsWith('$[') && piece.endsWith(']');
}
Transforms the duplicate key error by checking for duplicate key error messages by path.
If no duplicate key error messages are found, returns the original error.

@param {Error} error The error to transform
@returns {Error} The transformed error
@api private