The device you need to control the force & direction of a solenoid is the same device you need to control the speed & direction of a DC motor. It's an H-Bridge. For a full-size Arduino like an UNO you would typically use a Motor Control Shield. For an Arduino Mini you can't use a standard shield so you should probably look for a breakout board.

You need to determine the voltage and current requirements of your devices so you can pick an appropriate H-Bridge.