Skip to content

Instantly share code, notes, and snippets.

@ableasdale
Created February 23, 2016 10:30
Show Gist options
  • Save ableasdale/d9582de20991b87bba0a to your computer and use it in GitHub Desktop.
Save ableasdale/d9582de20991b87bba0a to your computer and use it in GitHub Desktop.
MarkLogic JSearch example
var jsearch = require('/MarkLogic/jsearch.sjs');
jsearch.documents()
.where( jsearch.byExample({ orderDate: {$ge: "1960-01-01T00:00:00.000"} }) )
.orderBy(cts.indexOrder(cts.jsonPropertyReference('orderDate'), 'ascending'))
.slice(0,10)
.map(function(doc) {return doc.document;})
.withOptions({returnQueryPlay: true})
.result();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment