For example, if you have such data
let usersRef = Firestore.firestore().collection("Users")
usersRef.document("UserA").setData([
"name": "UserA",
])
usersRef.document("UserB").setData([
"name": "UserB",
])
Write like this
let postRef = usersRef.order(by: "name")
.start(at: [The character string you want to search]).end(at: [The character string you want to search + "\u{f8ff}"])
Recommended Posts