MarkLogic 12 EA 1 Product Documentation
vec:base64-decode

vec:base64-decode(
   $base64-vector as xs:string
) as vec:vector

Summary

Returns a vector value by decoding the base64 encoded string input.

Parameters
base64-vector The base64 binary encoded string vector to decode.

See Also

Example

  xquery version "1.0-ml";
  vec:base64-decode('FYT6NiFJhGw=AwAAAA==AAAAAA==w/VIQB+Fyz+amSlA')

  => [ 3.14, 1.59, 2.65 ] (: String representation of the decoded vector value :)

Example

  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'.
Powered by MarkLogic Server | Terms of Use | Privacy Policy