Skip to content

Commit

Permalink
Change update method to find, modify and upsert in to minimongo befor… (
Browse files Browse the repository at this point in the history
#227)

* Change update method to find, modify and upsert in to minimongo before calling the ddp update.

* Simplify logic
  • Loading branch information
malithjkmt authored and charpeni committed Oct 24, 2017
1 parent dea57bc commit c4fbeb0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Collection.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ export class Collection {
reason: `Item not found in collection ${this._name} with id ${id}`
});

// change mini mongo for optimize UI changes
this._collection.upsert({ _id: id, ...modifier.$set });

Data.waitDdpConnected(()=>{
call(`/${this._name}/update`, {_id: id}, modifier, err => {
if(err) {
Expand Down

0 comments on commit c4fbeb0

Please sign in to comment.