# Incorrect example in documentation (?)

**URL:** <https://discuss.aerospike.com/t/incorrect-example-in-documentation/6799>\
**Category:** General Discussion\
**Tags:** aggregation\
**Created:** [November 8, 2019, 5:23pm UTC](https://discuss.aerospike.com/t/incorrect-example-in-documentation/6799 "2019-11-08T17:23:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fschaeffler](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/fschaeffler/32/1301_2.png) [@fschaeffler](https://discuss.aerospike.com/u/fschaeffler)\
**Post date:** [November 8, 2019, 5:23pm UTC](https://discuss.aerospike.com/t/incorrect-example-in-documentation/6799/1 "2019-11-08T17:23:03Z")

</div>

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](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?

---

<div class="post-metadata">

**Author:** ![ZoharE](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/zohare/32/1120_2.png) [@ZoharE](https://discuss.aerospike.com/u/ZoharE)\
**Post date:** [November 11, 2019, 10:46am UTC](https://discuss.aerospike.com/t/incorrect-example-in-documentation/6799/2 "2019-11-11T10:46:53Z")

</div>

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.
