Ah, right: “cast as”… I was trying to remember that syntax earlier. Thanks Mike.

-Will

On May 12, 2014, at 2:36 PM, Michael Blakeley <[email protected]> wrote:

> I can reproduce that XDMP-ARGTYPE with 7.0-2.3 on OSX. I suspect it's a bug. 
> Another workaround is:
> 
> json:array-size(
>  cts:value-tuples(
>    cts:element-reference(xs:QName('prop:last-modified')))[1]
>  cast as json:array)
> 
> BTW xdmp:type seems to agree that the output from cts:value-tuples is already 
> a json:array, returning QName("http://marklogic.com/xdmp/json";, "array").
> 
> -- Mike
> 
> On 12 May 2014, at 12:08 , Will Thompson <[email protected]> wrote:
> 
>> This is interesting. Even though the return value is reported as a 
>> json:array, the function works if it’s coerced into a json:array before 
>> calling:
>> 
>> let $tuple as json:array := cts:value-tuples($some-cts-reference)[1]
>> return json:array-size($tuple)
>> => 1
>> 
>> 
>> On May 12, 2014, at 12:15 PM, Will Thompson <[email protected]> 
>> wrote:
>> 
>>> let $tuple := cts:value-tuples($some-cts-reference)[1]
>>> return xdmp:describe($tuple)
>>> =>
>>> json:array(<json:array...><json:value ...>...</json:array>)
>>> 
>>> return json:array-size($tuple)
>>> =>
>>> [1.0-ml] XDMP-ARGTYPE: (err:XPTY0004) 
>>> json:array-size(json:array(<json:array>...</json:array>)) -- arg1 is not of 
>>> type json:array?
>>> 
>>> Am I missing something, or should I contact support?
>>> 
>>> -Will
>>> _______________________________________________
>>> General mailing list
>>> [email protected]
>>> http://developer.marklogic.com/mailman/listinfo/general
>> 
>> _______________________________________________
>> General mailing list
>> [email protected]
>> http://developer.marklogic.com/mailman/listinfo/general
>> 
> 
> _______________________________________________
> General mailing list
> [email protected]
> http://developer.marklogic.com/mailman/listinfo/general

_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to