For FreeBSD version 8.0 and later, there is a MongoDB port you can use.
For FreeBSD versions 7.2 or earlier:
Get the database source: http://www.github.com/mongodb/mongo.
Update your ports tree:
sudo portsnap fetch && portsnap extract
The packages that come by default on 7.2 and older are too old and cause errors when you try to run the database.
Install SCons:
cd /usr/ports/devel/scons && make && make install
Install libunwind:
cd /usr/ports/devel/libunwind && make && make install
Change to the database source directory
Run:
scons all
See also