I prefer to see a single exit point in this function (yes. this is a very short function). Consider introducing a local variable to hold the reference to the database/collection.