1

When I ask for all snapshots in a given timeframe where the previous State value of a Task object is less than "Completed", I get zero results. However, if I switch around the inequality to greater than "Completed", I get the results I expected. I would have assumed that the states "Defined" and "In-Progress" were less than "Completed".

_TypeHierarchy:"Task",    
"_PreviousValues.State":{$lt: "Completed"},
State: "Completed",

The above query returns 0 results for a specified time range. But the query below returns 4137 results for the same time range (note, the only difference is the switch in inequalities from less than to greater than):

_TypeHierarchy:"Task",    
"_PreviousValues.State":{$gt: "Completed"},
State: "Completed",
Trever Shick
  • 1,734
  • 16
  • 17
Heather K
  • 61
  • 3

1 Answers1

2

The issue is that the LBAPI is not currently treating Task State as a drop down field like it should. We will enter a defect on it. Thanks for pointing out the problem!

In the meantime, you should be able to get the desired results using either '$ne: null' or '$in: ["Defined", "In-Progress"]'.

  • Thanks @rwest-rally. I figured out the workaround using $in fairly quickly, but wanted to post the question to make sure I understood how inequalities should work with drop down values (in case I am working with a drop down with more values and/or custom values). Thanks. – Heather K Feb 07 '13 at 16:33