This method handles type conversion from ext-mongodb to ext-mongo:
- For all instances of BSON\Type it returns an object of the
corresponding legacy type (MongoId, MongoDate, etc.)
- For arrays and objects it iterates over properties and converts each
item individually
- For other types it returns the value unconverted