handle strings and object id for mongo