Syntax:
JSON_CONTAINS(json_doc, val[, path])

Returns 0 or 1 to indicate whether a specific value is contained in a
target JSON document, or, if a path argument is given, at a specific
path within the target document. Returns NULL if any argument is NULL
or the path argument does not identify a section of the target
document. An error occurs if either document argument is not a valid
JSON document or the path argument is not a valid path expression or
contains a * or ** wildcard.

To check only whether any data exists at the path, use
JSON_CONTAINS_PATH() instead.

The following rules define containment:

o A candidate scalar is contained in a target scalar if and only if
  they are comparable and are equal. Two scalar values are comparable
  if they have the same JSON_TYPE() types, with the exception that
  values of types INTEGER and DECIMAL are also comparable to each
  other.

o A candidate array is contained in a target array if and only if every
  element in the candidate is contained in some element of the target.

o A candidate nonarray is contained in a target array if and only if
  the candidate is contained in some element of the target.

o A candidate object is contained in a target object if and only if for
  each key in the candidate there is a key with the same name in the
  target and the value associated with the candidate key is contained
  in the value associated with the target key.

Otherwise, the candidate value is not contained in the target document.

URL: http://dev.mysql.com/doc/refman/5.7/en/json-search-functions.html

