@@ -1561,7 +1561,7 @@ KuzzleDataCollection.prototype.createDocument = function (id, document, options,
1561
1561
}
1562
1562
1563
1563
if ( options ) {
1564
- action = options . updateIfExist ? 'createOrUpdate ' : 'create' ;
1564
+ action = options . updateIfExist ? 'createOrReplace ' : 'create' ;
1565
1565
}
1566
1566
1567
1567
if ( id ) {
@@ -1801,7 +1801,7 @@ KuzzleDataCollection.prototype.replaceDocument = function (documentId, content,
1801
1801
data = self . kuzzle . addHeaders ( data , this . headers ) ;
1802
1802
1803
1803
if ( cb ) {
1804
- self . kuzzle . query ( this . buildQueryArgs ( 'write' , 'createOrUpdate ' ) , data , options , function ( err , res ) {
1804
+ self . kuzzle . query ( this . buildQueryArgs ( 'write' , 'createOrReplace ' ) , data , options , function ( err , res ) {
1805
1805
var document ;
1806
1806
1807
1807
if ( err ) {
@@ -1813,7 +1813,7 @@ KuzzleDataCollection.prototype.replaceDocument = function (documentId, content,
1813
1813
cb ( null , document ) ;
1814
1814
} ) ;
1815
1815
} else {
1816
- self . kuzzle . query ( this . buildQueryArgs ( 'write' , 'createOrUpdate ' ) , data , options ) ;
1816
+ self . kuzzle . query ( this . buildQueryArgs ( 'write' , 'createOrReplace ' ) , data , options ) ;
1817
1817
}
1818
1818
1819
1819
return this ;
@@ -2038,7 +2038,7 @@ KuzzleDataMapping.prototype.apply = function (options, cb) {
2038
2038
options = null ;
2039
2039
}
2040
2040
2041
- self . kuzzle . query ( this . collection . buildQueryArgs ( 'admin' , 'putMapping ' ) , data , options , function ( err ) {
2041
+ self . kuzzle . query ( this . collection . buildQueryArgs ( 'admin' , 'updateMapping ' ) , data , options , function ( err ) {
2042
2042
if ( err ) {
2043
2043
return cb ? cb ( err ) : false ;
2044
2044
}
@@ -2380,7 +2380,7 @@ KuzzleDocument.prototype.save = function (options, cb) {
2380
2380
2381
2381
data . persist = true ;
2382
2382
2383
- self . kuzzle . query ( this . dataCollection . buildQueryArgs ( 'write' , 'createOrUpdate ' ) , data , options , function ( error , res ) {
2383
+ self . kuzzle . query ( this . dataCollection . buildQueryArgs ( 'write' , 'createOrReplace ' ) , data , options , function ( error , res ) {
2384
2384
if ( error ) {
2385
2385
return cb ? cb ( error ) : false ;
2386
2386
}
0 commit comments