Start by creating a secondary index:
You’ll want to include employee.salary in your index. (Of course, you’re not limited to just one item in a secondary index, so you can include other things as well.)
Once that’s up, you’re ready to execute queries against the secondary index.
Technically, you might have multiple employees that all have the same salary, which is also the highest salary in the company. So I’d actually break it up into 2 queries:
1. What’s the MAX(salary) ?
2. Enumerate the employees WHERE salary = max_salary
So query #1 is an aggregate query:
And query #2 is a standard query (now that you know max_salary):
Hope that helps.