Foxx queries

The createQuery method has been removed. It can be trivially replaced with plain JavaScript functions and direct calls to the db._query method:

Old:

  1. 'use strict';
  2. const Foxx = require('org/arangodb/foxx');
  3. const query = Foxx.createQuery({
  4. query: 'FOR u IN _users SORT u.user ASC RETURN u[@propName]',
  5. params: ['propName'],
  6. transform: function (results, uppercase) {
  7. return (
  8. uppercase
  9. ? results[0].toUpperCase()
  10. : results[0].toLowerCase()
  11. );
  12. }
  13. });
  14. query('user', true);

New:

  1. 'use strict';
  2. const db = require('@arangodb').db;
  3. const aql = require('@arangodb').aql;
  4. function query(propName, uppercase) {
  5. const results = db._query(aql`
  6. FOR u IN _users
  7. SORT u.user ASC
  8. RETURN u[${propName}]
  9. `);
  10. return (
  11. uppercase
  12. ? results[0].toUpperCase()
  13. : results[0].toLowerCase()
  14. );
  15. }
  16. query('user', true);