Mongo Update keeps adding to the the size of the collection
I'd hazard a guess that your code is running the upsert command fairly quickly. It may depend on your MongoDB version, but on the latest version an update command which does not specify update modifiers will just overwrite the entire document, which involves deleting and re-writing it. 

It seems likely that in between another upsert operation, a second upsert is run and when it sees no document it inserts a new one. In this case you might want to look at not updating the entire document. 

You could also look into using a unique index and a little re-try logic which might work for you based on how infrequently this appears to be happening.