Skip to content

Commit 901f247

Browse files
authored
Merge pull request #235 from derms/feature/issue-189-uni-temporal-configuration-example
added uni-temporal example
2 parents 87e58fc + e6e91bc commit 901f247

File tree

7 files changed

+75
-0
lines changed

7 files changed

+75
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
This project shows how to deploy a sample uni-temporal config (without lsqt configuration)
2+
3+
Note that (as of this version), the deployed temporal config cannot be changed except for the temporal collection option properties (refer to https://docs.marklogic.com/temporal:collection-set-options for possible values)
4+
5+
6+
Once you have deployed the code, you can insert documents uni-temporally by doing the following
7+
8+
```javascript
9+
'use strict';
10+
declareUpdate();
11+
const temporal = require("/MarkLogic/temporal.xqy");
12+
const root =
13+
{"tempdoc":
14+
{"content": "content here",
15+
systemStart: null,
16+
systemEnd: null}
17+
};
18+
temporal.documentInsert("uni-temporal-collection", "doc.json", root);
19+
```
20+
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
plugins {
2+
id "com.marklogic.ml-gradle" version "3.0.0"
3+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
mlHost=localhost
2+
mlAppName=uni-temporal-project
3+
mlRestPort=8400
4+
mlUsername=admin
5+
mlPassword=admin
6+
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"database-name": "%%DATABASE%%",
3+
"schema-database": "%%SCHEMAS_DATABASE%%",
4+
"range-element-index": [
5+
{
6+
"collation": "",
7+
"invalid-values": "reject",
8+
"localname": "systemStart",
9+
"namespace-uri": "",
10+
"range-value-positions": false,
11+
"scalar-type": "dateTime"
12+
}
13+
,
14+
{
15+
"collation": "",
16+
"invalid-values": "reject",
17+
"localname": "systemEnd",
18+
"namespace-uri": "",
19+
"range-value-positions": false,
20+
"scalar-type": "dateTime"
21+
}
22+
]
23+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"database-name": "%%SCHEMAS_DATABASE%%"
3+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"axis-name": "system",
3+
"axis-start": {
4+
"element-reference": {
5+
"namespace-uri": "",
6+
"localname": "systemStart"
7+
}
8+
},
9+
"axis-end": {
10+
"element-reference": {
11+
"namespace-uri": "",
12+
"localname": "systemEnd"
13+
}
14+
}
15+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"collection-name": "uni-temporal-collection",
3+
"system-axis": "system",
4+
"option": ["updates-safe"]
5+
}

0 commit comments

Comments
 (0)