The MongoDB driver supports the custom function escape CAST_TO_NATIVE, as described in the following topic.