Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: track multiple database transactions inside a method #21

Open
graemian opened this issue Jan 30, 2025 · 0 comments
Open

Comments

@graemian
Copy link

Hi,

I would like to be able to do things like

const loanAccId = Accounts.insert({name: "loan"})
Transactions.insert({amt: -100, accountId: loanAccId})

and

const fromAccId = Transactions.insert({amt: -100})
const toAccId = Transactions.insert({amt: 100, otherTxnId: fromAccId});

Transactions.update(fromAccId: {$set: {otherTxnId: toAccId}})

inside a Meteor method and have it handled correctly by jam:offline. This would ensure that the changes are synced to the server if they happen while the client is disconnected and the app is subsequently closed.

I had a look at updateLastMethod() inside idx.js and, as best I can tell, this isn't supported right now.

Is that correct? Is there perhaps a workaround?

I looked at the pipe feature from jam:methods, but that doesn't seem to be a solution either.

If not, let this be a feature request. It would be quite awesome if it was supported.

It doesn't seem that difficult. Instead of just tracking a single change, updateLastMethod() would just need to store an array of changes, I think.

Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant