Is it possible to define maximum points in scatter3d?

I need that when there are two points on the graph, it is updated and two new points appear, without accumulating (the data is stored in a JSON array).