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.

previous data lost when patch/remove with listStrategy='smart'

See original GitHub issue

I am not sure if I used it in a wrong way or this behavior is intentional:

app = feathers()
.configure(socketio(io('....'))
.configure(reactive(RxJS, {listStrategy: 'smart'}))

cards = app.service('cards')
cards.find().subscribe(data => console.log('a: ', data))

window.test= => cards.patch('xxx', {text:"new"})

Before running test(), the console shows an array of 10 items fetched from database; but after test() it has only one item left, that is the one been patched. The console looks like:

a: [Object, Object, Object, Object, Object, Object, Object, Object, Object, Object]
run()
a: [Object]

Same problem with update and remove. create is OK.

Is this a bug or I misunderstood what this package is for?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
dafflcommented, Nov 11, 2016

It’s probably because of idField not configure properly (which is set to id by default).

app.configure(reactive(RxJS, {listStrategy: 'smart', idField: '_id' }))

Should do it. I’ll probably change and make it mandatory.

0reactions
dafflcommented, Aug 28, 2017

Setting idField is now mandatory in v0.5.0 thanks to #58

Read more comments on GitHub >

github_iconTop Results From Across the Web

Intelligent way of removing items from a List<T> while ...
The best solution is usually to use the RemoveAll() method: myList.RemoveAll(x => x.SomeProp == "SomeValue");. Or, if you need certain elements removed:
Read more >
Search and organize lists in Reminders on iPhone
In Reminders on iPhone, search all your lists for items that contain specific text. Arrange items in lists and groups.
Read more >
Delete, disable & manage unused apps on Android
Unused apps to review apps that were unused and have been optimized. Pause app activity if unused toggle, then turn this off.
Read more >
Frequently Asked Questions - SMART Health Cards
How do I merge records if I was vaccinated at multiple locations or in different states/regions? What do I do if my name...
Read more >
Create and use lists - Knowledge Base - HubSpot
The lists tool in HubSpot allows you to create a list of contacts or companies ... Active lists automatically update their members based...
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