Mattresses are not small stuff that you can easily store anywhere without being damaged. It is something you lie on that gives you good sleep to be able to work the next day. It is not something you can easily change either since it costs a hefty sum and even if you can buy several at once, tossing the old one away carelessly will only add to the global garbage.
Always have some mattress bags handy so that you can get one whenever you have to leave for a long while. It will protect your mattress from bugs and any accidental wetness or moulds.