
vec:base64-decode( $base64-vector as xs:string ) as vec:vector
Returns a vector value by decoding the base64 encoded string input.
| Parameters | |
|---|---|
| base64-vector | The base64 binary encoded string vector to decode. |
xquery version "1.0-ml";
vec:base64-decode('kuF6JKCPwuUfzcwUIAAAAA==')
=> [ 3.14, 1.59, 2.65 ] (: String representation of the decoded vector value :)
xquery version "1.0-ml";
let $base64 := vec:base64-encode(vec:vector(xdmp:to-json(fn:doc('pronethalol.json'))/data/array-node{embedding}))
return vec:base64-decode($base64)
=> The vector value at array node 'embedding' in document 'pronethalol.json'.
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.