Added TTL to `constructUpsertQuery`. Also added the ability for `constructUpsertQuery` to automatically stringify parameters that are objects/arrays.