Skip to content

Support for mongo transactions#707

Open
boomfly wants to merge 8 commits into
jagi:v2from
boomfly:v2
Open

Support for mongo transactions#707
boomfly wants to merge 8 commits into
jagi:v2from
boomfly:v2

Conversation

@boomfly
Copy link
Copy Markdown

@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
Copy Markdown

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

@lukejagodzinski
Copy link
Copy Markdown
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.

3 participants