我有这个查询,因为你firstName包含单引号Anthony O' Neil
:> g.addV('person')
.property('firstName', 'Anthony O'Neil')
.property('lastName', 'Andersen')
.property('age', 44)
任何想法如何逃脱它?
答案 0 :(得分:6)
使用\
逃离撇号所以你的Gremlin变成了:
Layer (type) Output Shape Param #
=================================================================
conv2d_1 (Conv2D) (None, 1026, 1026, 128) 3584
_________________________________________________________________
conv2d_2 (Conv2D) (None, 1024, 1024, 3) 3459
=================================================================
Total params: 7,043
Trainable params: 7,043
Non-trainable params: 0
_________________________________________________________________
答案 1 :(得分:2)
找到答案
用于编码使用此: encodeURIComponent(“Anthony O'Neil”)。replace(/ [!'()*] / g,escape) 输出是:Anthony%20O%27Neil
用于解码使用此: decodeURIComponent( “安东尼%20O%27Neil”) 你会回来安东尼奥尼尔
如果您只想逃避单引号,请使用此代码进行编码: “Anthony O'Neill”.replace(/ [!'()*] / g,逃脱) 输出:Anthony O%27尼尔
和上面用于解码的功能相同