How to Merge and use toLower for the conditions

I have text data that I would like to allow both upper and lower case letters. But want to ignore case when doing merge operations.

For example, how do I apply toLower to o.name before it is compared to $name?

MERGE (u)-[:ACCESS]-(o:Object {name: toLower($name)})

You can approach it two ways that I can think of. I am assuming the Object node exists, as 'where' can not be used with "merge."

MATCH (o:Object)
WHERE toLower(o.name) = toLower($name)
MERGE (u)-[:ACCESS]-(o)
return u, o

or, with regex pattern

MATCH (o:Object)
WHERE o.name =~ "(?i)" + $name
MERGE (u)-[:ACCESS]-(o)
return u, o

Thanks, I ended up using an optional match followed by an apoc.do.when on the object to simulate a merge with

WHERE toLower(o.name) = toLower($name)