You maybe would also look into this post:
MongoDB 6.0 is already compiling for FreeBSD, but it is segfaulting, maybe this will be also related to OpenBSD. Maybe have a look here how mongodb 6.0 is build for FreeBSD: https://cgit.freebsd.org/ports/tree/databases/mongodb60