Use JSON type. It greatly simplifies things...
Use settings.table, not tableName

This is a consequence of jugglingdb master