Brew installing wrong architecture for MacOS Sonoma w/Apple M1

Hello, I am trying to install mongodb for the first time on my MacBook Pro M1 running Sonoma 14.5. After I run

 brew tap mongodb/brew
 brew update
 brew install mongodb-community@8.0

it installs successfully. I then run

brew services start mongodb-community@8.0

which gives no errors. When I view brew list however, it does indicate an error. When I run mongod it gives an error of Illegal hardware instruction, which is indicative of the wrong architecture.

Looking at the output from brew install I see that the filename contains mongodb-macos-x86_64-8.0.4.tgz which is Intel. I haven’t had this issue with any other package installed via Homebrew.

Any help? Thanks!

Turns out I did have Rosetta enabled on my terminal, which meant brew was using an Intel setup. Disabling that, uninstalling and reinstalling brew (including all my programs/taps) fixed my issue.