Revert "simplify mongo query by using $setOnInsert, requires mongo 2.6"

This reverts commit 2df1b043b63957c2fe3da7fc95809158a55af20a.