N1QL node.js - Can someone please post an example of a parameterized query?

Wow! Yeah, that did it!

I was using named parameters because it was presented as an option on this page.

Placeholders may also be named. This is particularly useful when there are many query parameters and ensuring that they are all in the correct order may be cumbersome. Name query placeholders take the form of $name.

Furthermore, the Node.js SDK documentation says that params can accept an Object or Array and the description explicitly states:

A list or map to do replacements on a N1QL query.

Thus, I figured the SDK would work as described.

I suppose I can use the array method if that’s my only option. But is there a way to make the named parameters work? Some of my queries have a lot of parameters and it would be nice to use the name/map method.

Kind regards,
David