Comments (7)
What exactly are you trying to do? Creating your own sorter might be a bit complicated (the default one is being created from the query parameters using internals of the feathers-memory
database adapter).
If you are just changing the query you might want to look at the solution from #39
from feathers-reactive.
I'm actually using that example just getting some strange behaviour.
This is the query I have set up
this.query = new BehaviorSubject({
$limit: 50,
$skip: 0,
published: true,
$sort: {
materialType: 1,
weight: 1
}
});
then later on I have
getItems() {
this.serviceSub = this.query.mergeMap(query => {
return this.mainService.find({ query: query })
});
this.serviceSub.subscribe(resp => {
this.total = resp.total;
this.items = resp.data;
this.isLoading = false;
});
}
this loads the data as expected, but if i then do a patch update on an item such as
this.mainService.patch(id, {
published: status
});
the list is no longer sorted correctly, it seems to be sorted just by the weight attribute.
Oddly though, if I remove $limit and $skip from the query the sorting seems to stay correct.
from feathers-reactive.
$skip
is definitely one of the edge cases where the normal smart
strategy might not work because we won't know if the changed entry even still goes into that list.
If just the sorting is off there might still be a bug though. What database are you using?
from feathers-reactive.
I'm actually using the always
strategy as I was finding the list would become empty when doing the same patch. I'm using mongo/mongoose for the database.
from feathers-reactive.
If the list becomes empty you may not have set the correct idField property.
from feathers-reactive.
Already have that set like
configure(rx(RxJS, {listStrategy: 'always', idField: '_id'}))
from feathers-reactive.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Apologies if the issue could not be resolved. FeathersJS ecosystem modules are community maintained so there may be a chance that there isn't anybody available to address the issue at the moment. For other ways to get help see here.
from feathers-reactive.
Related Issues (20)
- An in-range update of webpack is breaking the build 🚨 HOT 8
- Sequelize query with $like throws unknown operation $like error HOT 3
- An in-range update of webpack-cli is breaking the build 🚨 HOT 5
- An in-range update of @types/feathersjs__feathers is breaking the build 🚨 HOT 4
- An in-range update of babel-plugin-add-module-exports is breaking the build 🚨 HOT 2
- An in-range update of babel-loader is breaking the build 🚨 HOT 1
- `@feathersjs/adapter-commons` dependency
- Typings support for feathers-reactive HOT 3
- An in-range update of webpack is breaking the build 🚨 HOT 2
- How force subscribe to fetch agian HOT 4
- How to unsubscribe() ? HOT 2
- Dove Support HOT 7
- Allow to Re-fetch all data when using smart listStrategy
- Hook generating patched/updated event before created event generates doublons
- Cannot call addListener on the client service connection HOT 14
- Cannot use import statement outside a module on v0.10.0 HOT 4
- Adding watch() in Angular HOT 1
- Failure to import in v0.10 HOT 3
- Sort property not available on objects raises an error
- Error: Cannot find namespace 'sift'. HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from feathers-reactive.