Right now, we can't use `$each` without also using `$slice`. The large, negative slice retains the last 1024 entries. If we expect to have more than that many entries for a survey + base object, then we should increase the number. But if that's common, we might also need to rethink the overall structure.

This code also has no bearing on the tile server, since it's used to create an upsert statement for adding new entries. But it's a valid question, since we have the same code on the API server.