What is the easiest way to connect MongoDB with Xcode/SwiftUI?

Hello! Thanks for your reply, I really appreciate it!

I can understand the confusion, I’ll clarify now:

  1. When I say that “I’ll use CoreData for the rest of the app’s lifecycle”, it’s because I’m focusing on iOS frameworks. Someone in a group study suggested MongoDB to store the initial content of my app because hard coding it in Xcode has become a boilerplate, but there’s so much to learn about MongoDB that I feel I’m using a bazooka to kill a fly.

  2. When I say “I just need to store the initial data on the web”, it’s because my app has initial data that users need to interact and customize as soon as the app launches. So my plan is to have that data in an online database service (this is where MongoDB came in) and download that info into CoreData for the rest of the functionality (filtering, etc).

  3. When I wrote “the main focus of the app is to use Realm” I was talking about the HabitsApp tutorial. I checked this tutorial to learn more about Realm and to see if I can use it for my app, but again, I’ll persist data using CoreData. I also took a look at this example which uses Vapor and the Swift driver which is “no longer under active development as of 2022”.

I’m new to iOS Development and totally clueless about “hosting” my data model online but I’m sure it’s something I have to do to make my code cleaner and scalable. I’ve never set up an application service before and I’ve only worked with relational databases in the past (a while ago). I feel MongoDB offers way more than I need and it’s better suited for more complex projects and that’s why it’s been so difficult to find the right path to start.

I hope this clarifies a bit where I’m standing.
Thanks again for your time

KB