You won’t even need to come here, since the documentation has the right code now as well ;). I have a private little database of code snippets put into Evernote, and I hurried to add this little thing to it for the next time I need it.
You could probably mark my post with the code as the solution, so others coming here find it right away ;).
Good luck with the next 25(0) projects then ;).