Check if it is not already in the library.

(We could make documents in the library bigger than just `_id`, so `$addToSet` will not necessary do the right thing. Make it future proof.)