Do a prefix search in Swift's Firestore

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

Do a prefix search in Swift's Firestore
Add a search function in Rails.
Do something like a JS immediate function in Ruby
How to write a date comparison search in Rails
What to do if you get a java.io.IOException in GlassFish
Establish a search bar in Rails ~ Join multiple tables to search