Ok, so I've been searching online and cannot find a solution for my issue. I've used the following queries, but still no luck:
.whereField("Features.tagName", arrayContains: tagName)
.whereField("Features", arrayContains: "tagName: \(tagName)")
.whereField("Features", arrayContains: "tagName: \(tagName)")
.whereField("Features", arrayContainsAny: [tagName])
.whereField("Features", in: [tagName])
.whereField("Features.tagName", arrayContainsAny: [tagName])
I thought I'd add these to show if I'm on the right track and to hopefully avoid any confusion or the event of recommending any of these queries as a solution.
I am pointing to the right collection as I've declared a global constant which I can call and have used for other queries/methods.
My database is structured as so:
Post -
PostID -
username
date
features[]
However, it must be noted my features array is structured like this:
features: [
[0] tagName: "Blue",
[1] tagName: "Yellow"
]
I cannot seem to return anything. I am only querying by one tag. I've got a strong feeling it's because of tagName
. But I've used interpolation or well tried to, but still not luck.
Anyone have a clue where I'm going wrong?