Get related posts excluding current post in Craft 3 In Craft 3, I’m trying to get the five most recent other posts sharing a category with the current post.  I got this far:

{% for relatedPost in craft.entries.relatedTo(entry.newsCategory).limit(5) %}


That gets five posts sharing the current post’s category, including the current post if it happens to be recently posted.  How do I exclude the current post from the returned results, without just dropping it from the five so I’m only left with four?
To exclude the current post use the current post's id with a "not" clause in the id query param.

{% for relatedPost in craft.entries.relatedTo(entry.newsCategory).id('not ' ~ entry.id).limit(5).all() %}