概述
castToRaw()
函数将字符串对象转换为二进制对象。
语法
castToRaw(value)
参数 | 类型 | 描述 |
---|---|---|
value |
String | 待转换的值 |
返回值类型:Blob
结果示例
with "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAdgAAAHYBTnsmCAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAEgSURBVDiNtdI9K8VhGAbwn5NynOIoJSZK5C0WNhPO4AvYZOMD2EwSWYwGA6UMymK0WJSBjAbJokgsJC8lL8fwf45zOv6HkKvuep77ua779eGPKCvhL0cj6gPnCqd4/i7gENZxg2yR3WIDw3EVtGAJA3jENnZxGd4b0I9BpLCDCRxDBte4xwzSBQmSqCy412AWD0GTgfPQX3cgdWEFFwXlX2ENfYHTEzRn0BmylmEOL3jFPlaD7QXfGxZFQ04H7QcmQ7YttPqMZmwGznzMuw6MI4FqTOMAh6IBN4Uqx9AbFyCHZBBl8YS7cL5GezE5ERMgJepxClWiXkdEK637KnMxKrCAZdT+RJjDqPwa50qR4lrI4US0Ojj6TQXQJv95/gfvUXJAokHwHHMAAAAASUVORK5CYII=" as base64
insert().into(@default).nodes({profile_photo: castToRaw(base64)}) as n
return n.profile_photo
{"type":"Buffer","data":[100,97,116,97,58,105,109,97,103,101,47,112,110,103,59,98,97,115,101,54,52,44,105,86,66,79,82,119,48,75,71,103,111,65,65,65,65,78,83,85,104,69,85,103,65,65,65,66,65,65,65,65,65,81,67,65,89,65,65,65,65,102,56,47,57,104,65,65,65,65,66,72,78,67,83,86,81,73,67,65,103,73,102,65,104,107,105,65,65,65,65,65,108,119,83,70,108,122,65,65,65,65,100,103,65,65,65,72,89,66,84,110,115,109,67,65,65,65,65,66,108,48,82,86,104,48,85,50,57,109,100,72,100,104,99,109,85,65,100,51,100,51,76,109,108,117,97,51,78,106,89,88,66,108,76,109,57,121,90,53,118,117,80,66,111,65,65,65,69,103,83,85,82,66,86,68,105,78,116,100,73,57,75,56,86,104,71,65,98,119,110,53,78,121,110,79,73,111,74,83,90,75,53,67,48,87,78,104,80,79,52,65,118,89,90,79,77,68,50,69,119,83,87,89,119,71,65,54,85,77,121,109,75,48,87,74,83,66,106,65,98,74,111,107,103,115,74,67,56,108,76,56,102,119,102,52,53,122,79,118,54,72,107,75,118,117,101,112,55,55,117,97,55,55,57,101,71,80,75,67,118,104,76,48,99,106,54,103,80,110,67,113,100,52,47,105,55,103,69,78,90,120,103,50,121,82,51,87,73,68,119,51,69,86,116,71,65,74,65,51,106,69,78,110,90,120,71,100,52,98,48,73,57,66,112,76,67,68,67,82,120,68,66,116,101,52,120,119,122,83,66,81,109,83,113,67,121,52,49,50,65,87,68,48,71,84,103,102,80,81,88,51,99,103,100,87,69,70,70,119,88,108,88,50,69,78,102,89,72,84,69,122,82,110,48,66,109,121,108,109,69,79,76,51,106,70,80,108,97,68,55,81,88,102,71,120,90,70,81,48,52,72,55,81,99,109,81,55,89,116,116,80,113,77,90,109,119,71,122,110,122,77,117,119,54,77,73,52,70,113,84,79,77,65,104,54,73,66,78,52,85,113,120,57,65,98,70,121,67,72,90,66,66,108,56,89,83,55,99,76,53,71,101,122,69,53,69,82,77,103,74,101,112,120,67,108,87,105,88,107,100,69,75,54,51,55,75,110,77,120,75,114,67,65,90,100,84,43,82,74,106,68,113,80,119,97,53,48,113,82,52,108,114,73,52,85,83,48,79,106,106,54,84,81,88,81,74,118,57,53,47,103,102,118,85,88,74,65,111,107,72,119,72,72,77,65,65,65,65,65,83,85,86,79,82,75,53,67,89,73,73,61]}