1
0
-1

If I want to search all txn that was saved 3 or more days ago, how do I do it using TxnQuery?

I can see in Txn.timeUserLastModified will give me the date user last modified, but in TxnQuery there doesn't seem to be methods for me to search based on that, or is there? 


    CommentAdd your comment...

    1 answer

    1.  
      1
      0
      -1

      Hi Mike

      We have plans to implement that already. At the moment basically a workaround might be to query Txn-s ordered by and then iterate/filter them manually, e.g:

      import com.avoka.tm.query.TxnQuery;
      
      
      List<Txn> txns = new TxnQuery()
          .set...
          .addOrderByAsc("timeCompleted")
          .listValues();
      
      
      //then over txn list iterate, filter, break ...


      Regards
      Rado

      1. Mike Chen

        Hi Rado,

        Thanks for your response, I am just wondering is there a way to filter out by dates before the list got returned?

        This script will do sort based on "timeCompleted", but when it returns, it will return the whole sorted list with potentially thousands of entries. Wouldn't it cause a lot of stress on performance of the system if I return a whole list back? 

         

      CommentAdd your comment...