How to update a document in an array?

My current solution is:

filter := bson.D{primitive.E{Key: "_id", Value: objectId}}
arrayFilters := options.ArrayFilters{Filters: bson.A{bson.M{"x._id": objectRid}}}
    upsert := true
    opts := options.UpdateOptions{
    	ArrayFilters: &arrayFilters,
     		Upsert:       &upsert,
    }
    update := bson.M{
    	"$set": bson.M{
    		"rooms.$[x].name": newName,
    		"rooms.$[x].floor": newFloor
           },
    }
    ret, err := collection.UpdateOne(handler.ctx, filter, update, &opts)

Do you have suggestions to improve my current solution? Is there a cleaner/shorter way to do this?