Incorrect example in documentation (?)

In the Node.js documentation for aggregation, the last step of the example seems incorrect to me.

https://www.aerospike.com/docs/client/nodejs/usage/query/aggregate.html#executing-the-query

So it’s saying in the description that […] to execute the query and apply the Stream UDF use query.apply() […]. However, in the source code example it’s saying client.apply('example', 'count', function (error, result) { ... }.

Normally, I would assume that I need to apply the Stream UDF to the query and not the client. Is that assumption correct?

It looks like you’re right - the client.apply works on a record udf (apply the udf to a specific record) while the query.apply works for stream udf.

© 2015 Copyright Aerospike, Inc. | All rights reserved. Creators of the Aerospike Database.