Open veeve opened 5 years ago
For now, one will have to recreate the collection in order to modify field mappings.
That said, one can modify records that have already been loaded into a collection using the INSERT INTO SELECT
statement.
For example - say you have a collection called users
and want to anonymize a field called email_address
into a new field email_hash
and wipe out the original field email_address
from the users
collection, you can do:
INSERT INTO users(_id, email_hash, email_address)
SELECT _id, TO_HEX(SHA256(u.email_address)) as email_hash, null as email_address
FROM users u
WHERE u.email_address IS NOT null
If you use INSERT INTO SELECT
, please note that without field mappings, data from new inserts/updates will not be anonymized, and you will have to re-run the statement above periodically to anonymize them.
Currently, field mappings need to be specified at collection creation time. Allow these to be altered on an existing collection.