Loading TOC...

MarkLogic 12 EA 1 Product Documentation
vec.get

vec.get(
   vector1 as vec.vector,
   k as Number
) as Number

Summary

Returns the element at the k-th index of the vector.

Parameters
vector1 The vector to grab the k-th element of.
k The zero-based index of vector1 to return. If k is greater than the number of elements in the vector, throw VEC-OUTOFBOUNDS.

Example

  const vec1 = vec.vector([3.14,1.59,2.65])
  vec.get(vec1, 2)

  => 2.65

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