Skip to content

Commit 93d3ffa

Browse files
author
Aries Yuwono
committed
Merge branch 'develop' of https://github.com/marklogic/node-client-api into develop
pull
2 parents faa7e5f + da23d99 commit 93d3ffa

File tree

5 files changed

+216
-136
lines changed

5 files changed

+216
-136
lines changed

CLA.adoc

Lines changed: 0 additions & 124 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
We welcome contributions from the community. If you have a patch that you'd
44
like us to consider, please do the following:
55

6-
* Provide a signed Contributor License Agreement (which can
7-
be found in etc/CLA.adoc).
6+
* Provide a signed
7+
[Contributor License Agreement](http://developer.marklogic.com/products/cla).
88

99
* Create an issue for the fix or enhancement.
1010

lib/documents.js

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,13 @@ function createWriteStream(document) {
390390
* the {@link transforms#write} function.
391391
* @param {string} [forestName] - the name of a forest in which to write
392392
* the documents.
393+
* @param {string} [temporalCollection] - the name of the temporal collection;
394+
* use only when writing temporal documents that have the JSON properties or XML elements
395+
* specifying the valid and system start and end times as defined by the valid and
396+
* system axis for the temporal collection
397+
* @param {string|Date} [systemTime] - a datetime to use as the system start time
398+
* instead of the current time of the database server; can only be supplied
399+
* if the temporalCollection parameter is also supplied
393400
* @returns {ResultProvider} an object whose result() function takes
394401
* a {@link documents#writeResult} success callback.
395402
*/
@@ -448,11 +455,12 @@ function writeDocumentsImpl(contentOnly, args) {
448455
if (!valcheck.isNullOrUndefined(temporalCollection)) {
449456
endpoint += sep+'temporal-collection='+temporalCollection;
450457
if (sep !== '&') { sep = '&'; }
451-
}
452-
var systemTime = requestParams.systemTime;
453-
if (!valcheck.isNullOrUndefined(systemTime)) {
454-
endpoint += sep+'system-time='+systemTime;
455-
if (sep !== '&') { sep = '&'; }
458+
var systemTime = requestParams.systemTime;
459+
if (valcheck.isString(systemTime)) {
460+
path += '&system-time='+systemTime;
461+
} else if (valcheck.isDate(systemTime)) {
462+
path += '&system-time='+systemTime.toISOString();
463+
}
456464
}
457465
}
458466

@@ -653,6 +661,12 @@ function removeOutputTransform(headers, data) {
653661
* @method documents#remove
654662
* @param {string} uri - the uri for the database document
655663
* @param {string} [txid] - the transaction id for an open transaction
664+
* @param {string} [temporalCollection] - the name of the temporal collection;
665+
* use only when deleting a document created as a temporal document; sets the
666+
* system end time to record when the document was no longer active
667+
* @param {string|Date} [systemTime] - a datetime to use as the system end time
668+
* instead of the current time of the database server; can only be supplied
669+
* if the temporalCollection parameter is also supplied
656670
* @returns {ResultProvider} an object whose result() function takes
657671
* a {@link documents#removeResult} success callback.
658672
*/
@@ -692,9 +706,11 @@ function removeDocumentImpl(contentOnly, args) {
692706
}
693707
if (!valcheck.isNullOrUndefined(temporalCollection)) {
694708
path += '&temporal-collection='+temporalCollection;
695-
}
696-
if (!valcheck.isNullOrUndefined(systemTime)) {
697-
path += '&system-time='+systemTime;
709+
if (valcheck.isString(systemTime)) {
710+
path += '&system-time='+systemTime;
711+
} else if (valcheck.isDate(systemTime)) {
712+
path += '&system-time='+systemTime.toISOString();
713+
}
698714
}
699715

700716
var connectionParams = this.client.connectionParams;

0 commit comments

Comments
 (0)