Trying to update mongo image version in docker compose

I changed my mongo image version to 3.6 from 3.4 in my docker-compose.yml file

mongo:
    image: mongo:3.6
    ports:
      - 27020:27017
    volumes:
      ...

However, when I ran the container, I get the following error:

compose-mono-mongo-1  | 2023-04-13T09:36:20.686+0000 E STORAGE  [initandlisten] WiredTiger error (-31802) [1681378580:686101][7:0x7f7d24753d40], txn-recover: unsupported WiredTiger file version: this build  only supports major/minor versions up to 1/0,  and the file is version 2/0: WT_ERROR: non-specific WiredTiger error
compose-mono-mongo-1  | 2023-04-13T09:36:20.688+0000 E STORAGE  [initandlisten] WiredTiger error (0) [1681378580:688289][7:0x7f7d24753d40], txn-recover: WiredTiger is unable to read the recovery log.
compose-mono-mongo-1  | 2023-04-13T09:36:20.688+0000 E STORAGE  [initandlisten] WiredTiger error (0) [1681378580:688307][7:0x7f7d24753d40], txn-recover: This may be due to the log files being encrypted, being from an older version or due to corruption on disk
compose-mono-mongo-1  | 2023-04-13T09:36:20.688+0000 E STORAGE  [initandlisten] WiredTiger error (0) [1681378580:688312][7:0x7f7d24753d40], txn-recover: You should confirm that you have opened the database with the correct options including all encryption and compression options
compose-mono-mongo-1  | 2023-04-13T09:36:20.688+0000 E STORAGE  [initandlisten] WiredTiger error (-31802) [1681378580:688325][7:0x7f7d24753d40], txn-recover: Recovery failed: WT_ERROR: non-specific WiredTiger error
compose-mono-mongo-1  | 2023-04-13T09:36:20.698+0000 I -        [initandlisten] Assertion: 28595:-31802: WT_ERROR: non-specific WiredTiger error src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp 277
compose-mono-mongo-1  | 2023-04-13T09:36:20.699+0000 I STORAGE  [initandlisten] exception in initAndListen: 28595 -31802: WT_ERROR: non-specific WiredTiger error, terminating
compose-mono-mongo-1  | 2023-04-13T09:36:20.699+0000 I NETWORK  [initandlisten] shutdown: going to close listening sockets...
compose-mono-mongo-1  | 2023-04-13T09:36:20.699+0000 I NETWORK  [initandlisten] removing socket file: /tmp/mongodb-27017.sock
compose-mono-mongo-1  | 2023-04-13T09:36:20.699+0000 I NETWORK  [initandlisten] shutdown: going to flush diaglog...
compose-mono-mongo-1  | 2023-04-13T09:36:20.699+0000 I CONTROL  [initandlisten] now exiting
compose-mono-mongo-1  | 2023-04-13T09:36:20.699+0000 I CONTROL  [initandlisten] shutting down with code:100
compose-mono-mongo-1 exited with code 100

I even removed the old volume and recreated the container however I still get the error. How do I accomplish this?