strongloop / loopback

LoopBack makes it easy to build modern applications that require complex integrations.
http://loopback.io
Other
13.23k stars 1.2k forks source link

error doc using Date as function in lt and gt filter #1948

Closed Neil-UWA closed 8 years ago

Neil-UWA commented 8 years ago

https://docs.strongloop.com/display/public/LB/Where+filter#Wherefilter-gtandlt

Employees.find({
  where: { 
    date: {gt: Date('2014-04-01T18:30:00.000Z')}
  }
});

When Date is called as a function, it returns a String representing current date and time. Therefore the above example should be :

Employees.find({
  where: { 
    date: {gt: new Date('2014-04-01T18:30:00.000Z')}
  }
});
gunjpan commented 8 years ago

@Neil-UWA : Hi Neil, thank you for bringing this to our attention. It has been corrected now. Thanks again and have a great weekend :)