Skip to content

Commit 4910f8f

Browse files
committed
return array when removing an array, jsdoc #42
1 parent 89366f8 commit 4910f8f

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

lib/documents.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,7 +1065,8 @@ function removeOutputTransform(headers, data) {
10651065
var operation = this;
10661066

10671067
if (operation.contentOnly === true) {
1068-
return operation.uris[0]; // for deprecated backward compatibility
1068+
// for deprecated backward compatibility
1069+
return (operation.uris.length === 1) ? operation.uris[0] : operation.uris;
10691070
}
10701071

10711072
var wrapper = {
@@ -1090,12 +1091,12 @@ function removeOutputTransform(headers, data) {
10901091
* for the removed document
10911092
*/
10921093
/**
1093-
* Removes a database document; takes a configuration
1094+
* Removes one or more database documents; takes a configuration
10941095
* object with the following named parameters or, as a shortcut, one or more
10951096
* uri strings or an array of uri strings.
10961097
* @method documents#remove
10971098
* @param {string|string[]} uris - the uri string or an array of uri strings
1098-
* for the database documents
1099+
* identifying the database documents
10991100
* @param {string} [txid] - the transaction id for an open transaction
11001101
* @param {string} [temporalCollection] - the name of the temporal collection;
11011102
* use only when deleting a document created as a temporal document; sets the

lib/marklogic.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -435,13 +435,15 @@ function readClient() {
435435
}
436436
MarkLogicClient.prototype.read = readClient;
437437
/**
438-
* Removes a database document; takes a uri string identifying the document.
438+
* Removes one or more database documents; takes one or more uri strings
439+
* identifying the document.
439440
* The {@link documents#remove} function is less simple but more complete.
440441
* @method DatabaseClient#remove
441-
* @param {string} uri - the uri for the database document
442+
* @param {string|string[]} uris - the uri string or an array of uri strings
443+
* identifying the database documents
442444
* @returns {ResultProvider} an object whose result() function takes
443-
* a success callback that receives the uri string identifying the removed
444-
* document.
445+
* a success callback that receives the uri string or an array of uris strings
446+
* identifying the removed documents.
445447
*/
446448
function removeClient() {
447449
return documents.removeImpl.call(this.documents, true, mlutil.asArray.apply(null, arguments));

0 commit comments

Comments
 (0)