code: function _compareIds(a, b) {
          assert.strictEqual(typeof a, typeof b);
          if (_.isNumber(a)) {
              return a - b;
          }
          else if (_.isString(a)) {
              // Even with strings, we prefer numeric sort semantics,
              // i.e. a shorter string is always less than a longer string.
              if (a.length === b.length) {
                  return a.localeCompare(b);
              }
              else {
                  return a.length - b.length;
              }
          }
          else if (_.isArray(a)) {
              // handles cases like this: "id": [ "java.lang.Long", 16],
              assert.strictEqual(a[0], b[0]);
              assert.strictEqual(a.length, 2);
              assert.strictEqual(b.length, 2);
              return _compareIds(a[1], b[1]);
          }
          else {
              dlog('Whatup?', a, b);
              assert(false, 'Unexpected element id type:' + typeof (a));
          }
      }
docs: ### `_compareIds()` Compares two Tinkerpop elements (vertex or edge) by their ID. Tinkerpop allows different datatypes to be used for ID. This method requires that both IDs be of the same type, and tries to do something reasonable for the various representations we might see from Tinkerpop.