JavaScript for inserts, updates, aggregation, etc.