#Day72 of #100DaysOfCode
Today was a little stressful day… :-/ Sometimes, it’s just hard to manage everything at once… but I am hopeful it will soon be okk.
I continued working on the restaurant app and found out that the schema I had created was incorrect. I defined borough as a partition key on the cloud and that will stay the same in all collections and documents. I cannot change it to be something else… so I made some destructive schema changes… 
Now my new schema looks like the below:
open class Borough (
@PrimaryKey
var _id: ObjectId = ObjectId(),
var borough: String? = "borough",
var location: String = ""
): RealmObject() {
}
I had to remove _partition since my selected key was borough so I kind of kept the same value for it and kept location as a separate field.
I did some error handling today as well. I found out that turning the development mode off reset the sync settings as well.
If you select the partition key as one of the fields from the collection, and when you select permissions from the template, it will select the default partition key instead of the field you selected as the partition key.
Now, the next step I am figuring out is creating UI dynamically after retrieving values from the database or if I am not able to do that, I will create a spinner and add the values from db there.
That is all today. Until tmrw 