Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.

Welcome, Guest
Guest Settings

Thread: Using TFDMongoQuery to query for a date range

This question is not answered. Helpful answers available: 2. Correct answers available: 1.

Permlink Replies: 0
James Nachbar

Posts: 14
Registered: 1/8/00
Using TFDMongoQuery to query for a date range  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 11, 2017 3:36 PM
I am trying to use the TFDMongoQuery to collect the documents that match a specific query, including filtering by dates.

I have no trouble doing it in the Mongo shell, with this query:

db.documents.find({docdate: { $lte: ISODate("2017-03-09")}}).count()

However, I get an error when I attempt setting QMatch property of the TFDMongoQuery object and opening it. The value of the string being used to set QMatch is "{ docdate: { $lte : ISODate(\"2017-03-09T00:00:00Z\") }}"

And the error I get is:

"Cannot read Infinity value. Path 'docdate.$lte', line 1, position 20"

I've tried a number of different options, including just the ISODate value, integers, etc, and none of them work.

Can you tell me how to search for a date range using the TFDMongoQuery?


Jim Nachbar

Edited by: James Nachbar on Mar 11, 2017 4:36 PM - {code} markup does not seem to be working

Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02