diff --git a/guide/source/2.8-migration.md b/guide/source/2.8-migration.md index ae66e3c94d..fb53d34817 100644 --- a/guide/source/2.8-migration.md +++ b/guide/source/2.8-migration.md @@ -37,6 +37,33 @@ Here are the newly added methods (you can see this description and the code [her for await (const document of collection.find(query, options)) /* ... */ ``` +

How can I start using these new features?

+ +We got a few examples for making it easy to use these new feature, you can look the code snippet bellow + +```js +// Before 2.8, we would use something like this +export const removeByID = ({ id }) => { + SomeCollection.remove({ _id: id }); +}; + +// Now we can also do like this +export const removeByIDAsync = async ({ id }) => { + await SomeCollection.removeAsync({ _id: id }); +}; + +Meteor.methods({ + //... + removeByID, + removeByIDAsync, +}); + +// In UI use Meteor.call('removeByID', { id }) or Meteor.call('removeByIDAsync', { id }) +``` + +More examples can be retrieved from [this commit](https://github.com/fredmaiaarantes/simpletasks/compare/main...mongodb-async-api). + +

Can I update to this version without changing my app?

Yes. You can update to this version without changing your app.