made AQL DOCUMENT function polymorphic