Loading TOC...

MarkLogic Server 11.0 Product Documentation
ort.getValue

ort.getValue(
   value as ort.value,
   index as (Number|String)
) as ort.value

Summary

For an ort.value with value type "SEQUENCE", returns the ort.value at specified index; for value type "MAP", index 0 returns the key, and index 1 returns the value.

Parameters
value An ort.value, with value type "SEQUENCE" or "MAP".
index The index.

Example

  const m = ort.map(ort.string(["key1","key2"],[2]),ort.value([1,2],[2],"float"))
  ort.getValue(m,0)
  =>
  OrtValue(Shape:[2], Type: STRING)

Example

  const m =
ort.map(ort.string(["key1","key2"],[2]),ort.value([1,2],[2],"float"))
  ort.getValue(m,1)
  =>
  OrtValue(Shape:[2], Type: FLOAT)

Example

  const s =
ort.sequence([ort.value([2,3],[2],"float"),ort.value([1],[1],"float"),ort.value([2],[1],"float")])
  ort.getValue(s,1)
  =>
  OrtValue(Shape:[1], Type: FLOAT)

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.