prep JSON documents for database insertion