
David Ennis (Clever Llamas) asked a question.
Hello my good friends at Progress.
Please see the following from the MarkLogic 12 documentation:
https://docs.progress.com/bundle/marklogic-server-javascript-reference-12/page/topics/language.html
Sample from the page:
- function* gen(limit){
- for (let i = 0; i < limit; i++)
- yield xdmp.eval('xs.dateTime(new Date())');}
- const result=[];
- for (const i of gen(10)){
- result.push(i);}
- result;
- /* returns ten different dateTime values (because they are each run
- in a separate eval) */
Now lets look at the known incompatibilities between the V8 engine in 12 and the previous version : https://docs.progress.com/bundle/marklogic-server-whats-new-12/page/topics/known-incompatibilities-with-previous-versions/between-marklogic-12-and-marklogic-11.html
Consider the sample about backwards compatibility showing how to write main modules in 12 (the export line):
- const result = {
- "hello": "world",
- "yourParam": external.myParam,
- "theDoc": external.doc
- }
- result
- export default result
With this in mind, I think that all of the samples in the main guide for 12 are incorrect and could make someone's head spin when they work in QC but return nothing as a main module.
Speaking of QC:
Example: https://docs.marklogic.com/12.0/cts.search
These will work in QC but not as main modules anymore (not that I see when someone would do that)
Issue addressed and document republished: https://docs.progress.com/bundle/marklogic-server-javascript-reference-12/page/topics/language.html.