Added mongo support, make query resolver to work as generic