Date gt filter not working
I am using find query in loopback where I need to filter availabilities based on the start_time. This is the following query I am using app.models.Activity.findOne({ where: { id: req.params.activityName }, include: { relation: 'availabilities', where: {start_time: {'gt': moment().toJSON()}} } })
I also tried where: {start_time: {'gt': Date.now()}} but that's also not working for me and it's returing the whole list. I am using loopback-mongodb connector "loopback-connector-mongodb": "^1.18.1", "loopback": "^3.0.0",
@sreerajkrishnank I would first try to make simple case work, for example, something like: https://github.com/strongloop/loopback-datasource-juggler/blob/2.x/test/basic-querying.test.js#L293
User.find({order: 'seq', where: {birthday: {'gt': new Date('1980-12-08')},
assuming start_timedata type is compatible with new Date()
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been closed due to continued inactivity. Thank you for your understanding. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS file at the top-level of this repository.