how to escape quotes in gremlin queries

后端 未结 2 1992
暗喜
暗喜 2021-01-12 20:57

I have this query and as you firstName contains single quote Anthony O\'Neil

:> g.addV(\'person\')
    .property(\'firstName\', \'Anthony O\'Neil\')
    .         


        
2条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-12 21:47

    Escape the apostrophe using \

    So your Gremlin becomes:

    :> g.addV('person')
        .property('firstName', 'Anthony O\'Neil')
        .property('lastName', 'Andersen')
        .property('age', 44)
    

提交回复
热议问题