question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Official query syntax for $gt, $gte does not work

See original GitHub issue

Steps to reproduce

I got a feathers-reactive service and i want to query some objects that have dates (named start in the example) that are greater then now:

this.someService.find({ query: { $sort: { start: 1 /* sorting works */ }, start: { $gte: moment().startOf('day').toDate() /* this breaks the updates */ } }, rx: { listStrategy: 'always' /* doesn't help */ } }); });

Expected behavior

I’m expecting updates to my subscription

Actual behavior

Initial query works, no updates (created …). Because of the initial query is working fine and because without the $gt on “start” the updates also work i think the issue is in feathers-reactive

System configuration

“feathers”: “^2.1.3”, “feathers-hooks”: “^2.0.1”, “feathers-reactive”: “github:feathersjs/feathers-reactive”, “feathers-rest”: “^1.7.3”, “feathers-socketio”: “^2.0.0”,

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:16 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
h-nasucommented, Mar 6, 2019

This is a closed issue, but I just wanted to point out I had difficult time filtering Date Range with nedb. The problem was I was storing Date object inside nedb and when filtering date from Feathers Client it was not working. The cause was Feathers converted the Date object to date string before the Find process, when nedb is expecting Date object. So all I have to do was convert the date string to Date object using before hook and filtering worked. Hope my finding helps people who have similar issue.

3reactions
DominikTrenzcommented, Oct 18, 2017

Great find @jobobo21 !! Thanks Indeed the date had to be in this format: ‘YYYY-MM-DDTHH:mm:ss[Z]’ and not a standard date object. Strange that every other crud method worked… This should really be documented somewhere, I spend so many days debugging 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

MongoDB - Greater than equals to Operator $gte
This operator is used to select those documents where the value of the field is greater than equals to(>=) the given value. You...
Read more >
Problem with query using $lt - Working with Data - MongoDB
When I use the gt and lt operators I get an error in lt. This is the query I'm doing: var list =...
Read more >
OData comparison operator reference - Azure Cognitive Search
Syntax and reference documentation for using OData comparison operators (eq, ne, gt, lt, ge, and le) in Azure Cognitive Search queries.
Read more >
Querying | feathers - FeathersJS
$gt, $gte. Find all records where the value is more ( $gt ) or more and equal ( $gte ) to a given...
Read more >
QuerySet API reference | Django documentation
These methods do not run database queries, therefore they are safe to run in ... blogs = Blog.objects.alias(entries=Count('entry')).filter(entries__gt=5).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found