I'm trying to filter my posts such that I only get the ones that have time that is in the future and that don't include the users posts. So my code is:
func fetchAllPosts() async throws -> [Post] {
try await fetchPosts(from: postsReference.whereField("time", isGreaterThan: Date()).whereField("author.id", isNotEqualTo: user.id))
}
However when I run the code I get this error:
Thread 2: "Invalid Query. All where filters with an inequality (notEqual, lessThan, lessThanOrEqual, greaterThan, or greaterThanOrEqual) must be on the same field. But you have inequality filters on 'time' and 'author.id'".
So does this mean that there is no way to filter my posts using inequality filters that work on two or more fields?
Thanks!