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

Support for mongo transactions #707

Open
wants to merge 8 commits into
base: v2
Choose a base branch
from
Open

Support for mongo transactions #707

wants to merge 8 commits into from

Conversation

boomfly
Copy link

@boomfly boomfly commented Jul 17, 2019

Check please support for mongo transactions. Related to feature request #706

import Post from './post'
import User from './user'
import { MongoInternals } from 'meteor/mongo';

let post = Post.find(postQuery);
let user = User.find(userQuery);

post.userId = user._id;
user.posts.push(post);

const { client } = MongoInternals.defaultRemoteCollectionDriver().mongo;
const session = await client.startSession();
await session.startTransaction();
try {
  post.save({session});
  user.save({session});
  await session.commitTransaction();
} catch (e) {
  await session.abortTransaction();
} finally {
  session.endSession();
}

@boomfly boomfly changed the title support for mongo transactions Support for mongo transactions Jul 17, 2019
@diavrank
Copy link

This feature would be great!!! Is there any ETA for this?

@lukejagodzinski
Copy link
Member

Hey, unfortunately I no longer actively develop this package. I only do bug fixes. Nowadays, there is less need for packages like this. Feel free to fork Astronomy or use custom local build with this feature merged.

Imho Meteor is not a nice option anymore, and soon it will be dead in terms of the new projects picking it as the main technology. It looks like even MDG focused their full power on Apollo. At work, I've stopped using Meteor a few years ago and I don't regret. As application grew the reactive nature of it caused more and more trouble and I feel more comfortable creating my own stack where I control every aspect of it. Also the development of Meteor stagnated. Even the 2.0 release doesn't introduce any deal breaker changes (at least from what I know).

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

Successfully merging this pull request may close these issues.

None yet

3 participants