Allow associative array to be used to set document