@@ -454,16 +454,14 @@ TarantoolConnection.prototype.update = function(spaceId, indexId, key, ops){
454454
455455
456456
457- TarantoolConnection . prototype . upsert = function ( spaceId , key , ops , tuple ) {
457+ TarantoolConnection . prototype . upsert = function ( spaceId , ops , tuple ) {
458458 return new Promise ( function ( resolve , reject ) {
459- if ( Number . isInteger ( key ) )
460- key = [ key ] ;
461459 if ( Array . isArray ( ops ) && Array . isArray ( key ) ) {
462460 if ( typeof ( spaceId ) == 'string' )
463461 {
464462 return this . _getMetadata ( spaceId , 0 )
465463 . then ( function ( info ) {
466- return this . upsert ( info [ 0 ] , key , ops , tuple ) ;
464+ return this . upsert ( info [ 0 ] , ops , tuple ) ;
467465 } . bind ( this ) )
468466 . then ( resolve )
469467 . catch ( reject ) ;
@@ -472,14 +470,10 @@ TarantoolConnection.prototype.upsert = function(spaceId, key, ops, tuple){
472470 var header = this . _header ( tarantoolConstants . RequestCode . rqUpsert , reqId ) ;
473471 var buffered = {
474472 spaceId : this . msgpack . encode ( spaceId ) ,
475- //indexId: msgpack.encode(indexId),
476473 ops : this . msgpack . encode ( ops ) ,
477- key : this . msgpack . encode ( key ) ,
478474 tuple : this . msgpack . encode ( tuple )
479475 } ;
480476 var body = Buffer . concat ( [ new Buffer ( [ 0x84 , tarantoolConstants . KeysCode . space_id ] ) , buffered . spaceId ,
481- //new Buffer([tarantoolConstants.KeysCode.index_id]), buffered.indexId,
482- new Buffer ( [ tarantoolConstants . KeysCode . key ] ) , buffered . key ,
483477 new Buffer ( [ tarantoolConstants . KeysCode . def_tuple ] ) , buffered . ops ,
484478 new Buffer ( [ tarantoolConstants . KeysCode . tuple ] ) , buffered . tuple ] ) ;
485479 if ( this . options . log )
0 commit comments