Fix upserts in Mongo integration scripts, too
Add mongo script for fixing the stupid way I thought I should handle unrecognized scopes