lib/commands/kv/riakobject.js
function(indexName, key) {
        if (this.indexes === undefined) {
            this.indexes = {};
        }
        if (!this.indexes.hasOwnProperty(indexName)) {
            this.indexes[indexName] = [];
        }
        for (var i = 1; i < arguments.length; i++) {
            this.indexes[indexName].push(arguments[i]);
        }
        return this;
    }
function(indexName, key) {
        if (this.indexes === undefined) {
            this.indexes = {};
        }
        if (!this.indexes.hasOwnProperty(indexName)) {
            this.indexes[indexName] = [];
        }
        for (var i = 1; i < arguments.length; i++) {
            this.indexes[indexName].push(arguments[i]);
        }
        return this;
    }
function ( indexName , key ) { if ( this . indexes === undefined ) { this . indexes = { } ; } if ( ! this . indexes . hasOwnProperty ( indexName ) ) { this . indexes [ indexName ] = [ ] ; } for ( var i = 1 ; i < arguments . length ; i ++ ) { this . indexes [ indexName ] . push ( arguments [ i ] ) ; } return this ; }
Add one or more keys to an index.

If the index does not exist it will be created.
@method addToIndex
@param {String} indexName the index name
@param {String|Number} ...key 1 or more keys to add
@chainable
Add one or more keys to an index .