def METHOD_NAME(entity_doc):
    """
    Check for entity duplicates in DB
    :param entity_doc: entity document
    :return: [], a list of errors otherwise
    """
    query = {'_id.id': entity_doc['_id']['id']}
    if 'type' in entity_doc['_id']:
        query['_id.type'] = entity_doc['_id']['type']
    else:
        query['_id.type'] = {'$exists': False}
    if 'servicePath' in entity_doc['_id']:
        query['_id.servicePath'] = entity_doc['_id']['servicePath']
    else:
        query['_id.servicePath'] = {'$exists': False}
    c = db[COL].find(query).count()
    if c > 1:
        return ['     * ERROR: duplicated entities number with same _id subfields: {0}'.format(c)]
    else:
        return []