databases/mongo: require json for .to_json

The examples in the next block use .to_json, and this needs a `require
'json'` on top.