Hey guys feeling quite dumb. Am new to MongoDB. Currently I’m moving a project of mine from Firebase to MongoDB, and do not want to take advantage of Realm. I strictly want to use MongoDB as shown here.
Question 1: Is this normal? Is this bad practice? I can’t seem to find a lot of StackOverflow posts of people using RealmSwift, and am getting very lost on trying to accomplish things.
Question 2: Here is a snippet of some code, a basic query I am performing.
Here are the class object I have posted to MongoDB.
Now here is where I have been ripping my hair out. In the query, (the first picture), once I have access to documents
. Let’s say I want to turn each document
into an object of class type Task
. How do I do that???
I found this link where you can see decoding and encoding in Swift, but it is not doing those operations on a Document
, but rather BSONDocument
- entirely different things!