There are times when rather than an "upsert" you need to select an object or insert it, if it wasn't there. Consider, for example, a feature that would make a post from some placeholder user:
Now let's make another post using the same placeholder
user (the user id
is the same as before):
You can verify by looking at the id
that no new
"Anonymous" user was created, instead the existing one
was selected as the author
.