mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Merge pull request #12170 from meteor/feat-changelog-2.8
chore: added how can I use section to change log
This commit is contained in:
@@ -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)) /* ... */
|
||||
```
|
||||
|
||||
<h3 id="how-do-i-update">How can I start using these new features?</h3>
|
||||
|
||||
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).
|
||||
|
||||
|
||||
<h3 id="should-i-update">Can I update to this version without changing my app?</h3>
|
||||
|
||||
Yes. You can update to this version without changing your app.
|
||||
|
||||
Reference in New Issue
Block a user