Part of issue #117 for mongodb