optimized for mongo 2.6 ($setOnInsert)