lib/instance/edit.js
function (k, v) {
        checkJobs.push(function (checkDone) {
          api.elasticsearch.search(self.alias, [k], [v], 0, 2, null, 1, function (error, results) {
            if (error) { return checkDone(error) }
            if (results.length === 0) { return checkDone() }
            if (results.length === 1 && results[0].guid === self.data.guid) { return checkDone() }
            return checkDone(new Error('uniqueFields:' + k + ' uniqueness violated via #' + results[0].guid))
          })
        })
      }
function (k, v) {
        checkJobs.push(function (checkDone) {
          api.elasticsearch.search(self.alias, [k], [v], 0, 2, null, 1, function (error, results) {
            if (error) { return checkDone(error) }
            if (results.length === 0) { return checkDone() }
            if (results.length === 1 && results[0].guid === self.data.guid) { return checkDone() }
            return checkDone(new Error('uniqueFields:' + k + ' uniqueness violated via #' + results[0].guid))
          })
        })
      }
function ( k , v ) { checkJobs . push ( function ( checkDone ) { api . elasticsearch . search ( self . alias , [ k ] , [ v ] , 0 , 2 , null , 1 , function ( error , results ) { if ( error ) { return checkDone ( error ) } if ( results . length === 0 ) { return checkDone ( ) } if ( results . length === 1 && results [ 0 ] . guid === self . data . guid ) { return checkDone ( ) } return checkDone ( new Error ( 'uniqueFields:' + k + ' uniqueness violated via #' + results [ 0 ] . guid ) ) } ) } ) }
We need to ensure that none of the params this new instance has match an existing instance.
We need to ensure that none of the params this new instance has match an existing instance .