anchor.diff:              | NamedValue(cypherExpr, paramName, value) ->
                   cypher.Create(cypherExpr).WithParam(paramName, value)
               | Anonymous(_) -> failwith "Can't create anonymous nodes"
  +
  +        member x.Merge(cypher: ICypherFluentQuery) =
  +            match x with
  +            | NamedValue(_cypherExpr, paramName, value) ->
  +                match NodeExpr.TryFindNeo4jKey value with
  +                | Some (keyName, keyValue) ->
  +                    let mergeExpr =
  +                        sprintf
  +                            "(%s:%s {%s: %A})"
  +                            paramName (value.GetType().Name) keyName keyValue
  +
  +                    cypher.Merge(mergeExpr)
  +                          .OnCreate()
  +                          .Set(sprintf "%s = {__arg}" paramName)
  +                          .WithParam("__arg", value)
  +                | None -> failwith "Value should have a unique Neo4jKey attribute"
  +
  +            | Var(_) -> failwith "Can't merge node whose value is unknown before running the query"
  +            | Anonymous(_) -> failwith "Can't merge anonymous nodes"
  +
  +        static member private TryFindNeo4jKey (entity: obj) =
  +            let properties = entity.GetType().GetProperties()
  +            properties
  +            |> Array.tryPick (fun prop ->
  +                prop.CustomAttributes
  +                |> Seq.tryPick (fun attr ->
  +                    if attr.AttributeType = typeof<Neo4jKeyAttribute> then
  +                        Some (prop.Name, prop.GetValue(entity))
  +                    else
  +                        None
  +                )
  +            )
   
       [<RequireQualifiedAccess>]
       [<NoComparison>]
  
positive.code: 
          impl expr
          |> Option.map (fun (entity, propChain) -> entity, List.rev propChain)
  
      let (|IsOperand|_|) (expr: Expr) =
          match expr with
  
negative.code: 
      let private executeMerge (cypher: ICypherFluentQuery) mergeExpr =
          match mergeExpr with
          | MergeNodeCall nodeExpr -> nodeExpr.Merge(cypher)
          | MergeRelationCall patternExpr -> patternExpr.Merge(cypher)
          | _ -> unsupportedScenario "MERGE expression" mergeExpr
  
  