Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

107
Views
cts query to filter documents from a particular collection for the last 24 hours

I have been trying to find the documents from a particular collection based on the field report_time.

I have been trying the below query. But, it doesn't work.

cts.andQuery(cts.collectionQuery('myCollection'),cts.jsonPropertyRangeQuery("report_time", ">", new Date(Date.now() - 86400 * 1000).toISOString()))
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

From that snippet, the one thing that needs adjustment is that the query criteria need to be in an array for the cts.andQuery() param:

cts.andQuery([
  cts.collectionQuery('myCollection'),
  cts.jsonPropertyRangeQuery("report_time", ">", new Date(Date.now() - 86400 * 1000).toISOString())
])
about 4 years ago · Juan Pablo Isaza Report

0

You don't have to do the math, you can use an "age query". See the end of the page at https://docs.marklogic.com/guide/search-dev/rangequery

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!