This code works but the same document gets returned multiple times. What supposed to happen is an array of [1,2,3,...] in the x-axis and [1,2,3,4, .....] in the y-axis gets