make string out of doc ids

instead of passing an array doc[1], doc[2]...
concat all ids into a string such as: '1,2,3'