MongoDB with Async Python Transcripts
Chapter: Beanie Quickstart
Lecture: Bunnet, the Synchronous Beanie
Login or
purchase this course
to watch this video and the rest of the course contents.
0:00
Let's close out this chapter with one final pointer. Throughout all of the code you see me write and all the examples, you've seen async and await.
0:10
Async methods and awaiting function calls all over the place. That's great if you want it, but sometimes you're just writing synchronous code
0:19
and you don't want to have to introduce all the layering, let's say, that running async code requires. So I might need to await a query.
0:28
Well, then that function itself has to be async and then how do you run it where it gets called, right? That can be a bit of a challenge.
0:35
So Roman Wright, the creator of Beanie, also created something called Bunnet. And Bunnet is basically a synchronous API version of Beanie for MongoDB.
0:46
So if you'd like to use that, here's an option. I'm on the fence about how much I'd recommend using two separate libraries for these two situations
0:57
rather than potentially just saying, I'm just going to call asyncIO.run more often, you know, down inside some function.
1:05
That said, if you want a synchronous version, check this out.
1:08
It's not as popular, not even close, as popular as Beanie, so take that for what it's worth. But you know, thanks Roman for creating this.