@@ -97,7 +97,7 @@ KuzzleDataCollection.prototype.advancedSearch = function (filters, options, cb)
9797
9898 query = self . kuzzle . addHeaders ( { body : filters } , this . headers ) ;
9999
100- self . kuzzle . query ( this . buildQueryArgs ( 'read ' , 'search' ) , query , options , function ( error , result ) {
100+ self . kuzzle . query ( this . buildQueryArgs ( 'document ' , 'search' ) , query , options , function ( error , result ) {
101101 var
102102 response ,
103103 documents = [ ] ;
@@ -151,7 +151,7 @@ KuzzleDataCollection.prototype.count = function (filters, options, cb) {
151151
152152 query = this . kuzzle . addHeaders ( { body : filters } , this . headers ) ;
153153
154- this . kuzzle . query ( this . buildQueryArgs ( 'read ' , 'count' ) , query , options , function ( error , result ) {
154+ this . kuzzle . query ( this . buildQueryArgs ( 'document ' , 'count' ) , query , options , function ( error , result ) {
155155 cb ( error , result && result . result . count ) ;
156156 } ) ;
157157} ;
@@ -174,7 +174,7 @@ KuzzleDataCollection.prototype.create = function (options, cb) {
174174 }
175175
176176 data = this . kuzzle . addHeaders ( data , this . headers ) ;
177- this . kuzzle . query ( this . buildQueryArgs ( 'write ' , 'createCollection ' ) , data , options , cb ) ;
177+ this . kuzzle . query ( this . buildQueryArgs ( 'collection ' , 'create ' ) , data , options , cb ) ;
178178
179179 return this ;
180180} ;
@@ -229,7 +229,7 @@ KuzzleDataCollection.prototype.createDocument = function (id, document, options,
229229
230230 data = self . kuzzle . addHeaders ( data , self . headers ) ;
231231
232- self . kuzzle . query ( this . buildQueryArgs ( 'write ' , action ) , data , options , cb && function ( err , res ) {
232+ self . kuzzle . query ( this . buildQueryArgs ( 'document ' , action ) , data , options , cb && function ( err , res ) {
233233 var doc ;
234234
235235 if ( err ) {
@@ -280,7 +280,7 @@ KuzzleDataCollection.prototype.deleteDocument = function (arg, options, cb) {
280280
281281 data = this . kuzzle . addHeaders ( data , this . headers ) ;
282282
283- this . kuzzle . query ( this . buildQueryArgs ( 'write ' , action ) , data , options , cb && function ( err , res ) {
283+ this . kuzzle . query ( this . buildQueryArgs ( 'document ' , action ) , data , options , cb && function ( err , res ) {
284284 if ( err ) {
285285 cb ( err ) ;
286286 }
@@ -312,7 +312,7 @@ KuzzleDataCollection.prototype.fetchDocument = function (documentId, options, cb
312312 self . kuzzle . callbackRequired ( 'KuzzleDataCollection.fetch' , cb ) ;
313313 data = self . kuzzle . addHeaders ( data , this . headers ) ;
314314
315- self . kuzzle . query ( this . buildQueryArgs ( 'read ' , 'get' ) , data , options , function ( err , res ) {
315+ self . kuzzle . query ( this . buildQueryArgs ( 'document ' , 'get' ) , data , options , function ( err , res ) {
316316 var document ;
317317
318318 if ( err ) {
@@ -398,7 +398,7 @@ KuzzleDataCollection.prototype.publishMessage = function (document, options, cb)
398398 }
399399
400400 data = this . kuzzle . addHeaders ( data , this . headers ) ;
401- this . kuzzle . query ( this . buildQueryArgs ( 'write ' , 'publish' ) , data , options , cb ) ;
401+ this . kuzzle . query ( this . buildQueryArgs ( 'realtime ' , 'publish' ) , data , options , cb ) ;
402402
403403 return this ;
404404} ;
@@ -431,7 +431,7 @@ KuzzleDataCollection.prototype.replaceDocument = function (documentId, content,
431431
432432 data = self . kuzzle . addHeaders ( data , this . headers ) ;
433433
434- self . kuzzle . query ( this . buildQueryArgs ( 'write ' , 'createOrReplace' ) , data , options , cb && function ( err , res ) {
434+ self . kuzzle . query ( this . buildQueryArgs ( 'document ' , 'createOrReplace' ) , data , options , cb && function ( err , res ) {
435435 var document ;
436436
437437 if ( err ) {
@@ -492,7 +492,7 @@ KuzzleDataCollection.prototype.truncate = function (options, cb) {
492492 }
493493
494494 data = this . kuzzle . addHeaders ( data , this . headers ) ;
495- this . kuzzle . query ( this . buildQueryArgs ( 'admin ' , 'truncateCollection ' ) , data , options , cb ) ;
495+ this . kuzzle . query ( this . buildQueryArgs ( 'collection ' , 'truncate ' ) , data , options , cb ) ;
496496
497497 return this ;
498498} ;
@@ -526,7 +526,7 @@ KuzzleDataCollection.prototype.updateDocument = function (documentId, content, o
526526
527527 data = self . kuzzle . addHeaders ( data , this . headers ) ;
528528
529- self . kuzzle . query ( this . buildQueryArgs ( 'write ' , 'update' ) , data , options , cb && function ( err , res ) {
529+ self . kuzzle . query ( this . buildQueryArgs ( 'document ' , 'update' ) , data , options , cb && function ( err , res ) {
530530 if ( err ) {
531531 return cb ( err ) ;
532532 }
0 commit comments