Skip to content

Commit d691308

Browse files
authored
DOCSP-42272 ISOdate/optime Substitutions (#8951)
* DOCSP-42272 optime Substitutions * Sub test * Sub test * Sub test * Sub text for primary example * Sub text for secondary example * Updates sub text * Updates sub text * Updates sub text * Updates sub text * Updates sub text * Updates sub text * Updates comments on script * Updates comments on script * Fixes code issue * Adds semicolon
1 parent 979cf85 commit d691308

File tree

3 files changed

+183
-152
lines changed

3 files changed

+183
-152
lines changed

bin/getTime.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/node
2+
/* getTime.js uses node to generate a recent timestamp and
3+
* ISODate formatted string of the same time. You can then
4+
* copy these values into the `timestamp` and `isodate` fields
5+
* in snooty.toml to ensure that examples for commands like
6+
* replSetGetStatus show recent dates and times.
7+
*
8+
* To use, run the file with Node.js:
9+
*
10+
* $ node bin/getTime.js
11+
* Update the following lines in snooty.toml:
12+
* timestamp = "Timestamp(1723762902, 1)"
13+
* isodate = "ISODate(\"2024-08-15T23:01:42.773Z\")
14+
*
15+
* Then, copy the return values into snooty.toml.
16+
*
17+
* Author: Kenneth P. J. Dyer <[email protected]>
18+
* Created: 2024-08-15
19+
* Updated:
20+
*/
21+
const n = new Date();
22+
const t = Math.floor(n / 1000);
23+
const d = n.toISOString();
24+
console.log("Update the following lines in snooty.toml:");
25+
console.log("timestamp = \"Timestamp(%d, 1)\"", t);
26+
console.log("isodate = \"ISODate(\\\"%s\\\")\"", d);

snooty.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,11 @@ sbe-short-title = "Slot-Based Execution Engine"
309309
fcv = ":abbr:`fCV (feature compatibility version)`"
310310
fts = "Atlas Search"
311311
atlas = "MongoDB Atlas"
312+
313+
# Timestamp Values (Run `node bin/getTime.js` to get more recent values
314+
timestamp = "Timestamp(1723763173, 1)"
315+
isodate = "ISODate(\"2024-08-15T23:06:13.978Z\")"
316+
312317
# Automerger Constants
313318
auto-merge-upper = "AutoMerger"
314319
auto-merge-lower = "automerger"

0 commit comments

Comments
 (0)