0

How to check the sequence of date in loopback query. I tried in 2016-05-24,2016-05-25 and '2016-05-24','2016-05-25' it is not worked but while going for one date it works fine. Can any one help me to fix this issue.

allDays = 2016-05-24,2016-05-25; or 
allDays = '2016-05-24','2016-05-25';
    LeaveLedger.find({
        where : {
                and : [{
                        date : {inq : [allDays]},
                        party_id : party_id,
                        status : {nin : [rejectedId, canclledId]}

                }]
        }

    }
VG__
  • 533
  • 2
  • 6
  • 16
  • Are you looking for specific dates, or a range? Because your search is it is right now is looking for specific dates (may 24 and 25th), and in order to do so - the values in the database will have to match EXACTLY the dates as you have them written. – Jonathan May 23 '16 at 16:24

1 Answers1

1

Got the answer,

Problem is allDay is in string instead of that I used array to check in loop back.

allDays = ['2016-05-24','2016-05-25'];
LeaveLedger.find({
        where : {
                and : [{
                        date : {inq : allDays},
                        party_id : party_id,
                        status : {nin : [rejectedId, canclledId]}
                    }]
        }
   }
VG__
  • 533
  • 2
  • 6
  • 16