Connect prolog to mongoDB

Hello I’m an university student and I have to do a project where I need to use prolog to calculate the best routes, and need those calculations to be read by a typescript SPA, all the data I need for my calculations come from mongoDB, what do you think is the best way to do it.
Thanks .

It depends on which Prolog system you’re using. If it’s one that offers a C/C++ bridge you can probably hook Prolog directly to MongoDB by writing some C/C++ code.