@@ -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