In the shell
----------------------------
> use crash
switched to db crash
> obj = {func : function()
}
{ "func" : function ()
}
> db.func.save(obj)
Using mongoexport
------------------------------
:~/$ /opt/mongo/bin/mongoexport -d crash -c func
connected to: 127.0.0.1
assertion: massert:Cannot create a properly formatted JSON string with element: func: function () {
print("hello");
} of type: 13