我在很新Firestore和Firebase图书馆。有人可以解释如何从我的字段中检索字段object并将其存储在代码中的变量中吗?我想访问所有latMin,latMax,lonMin和lonMax在我公司的FireStore每个对象,以及如果是检索每个字段名称相同的方式(例如,latMin从一个地方1和2)。我不知道这是否可能,也许还有一种更好的方式组织我的计划Firebase。
这是我的Cloud Firebase:这是我的Firestore的图像,在注释中要求。
place 1: //This is an Object in my Firestore
//Field = Number : Value ----> This is how object is orginazed
latMax : 39.727
latMin : 39.726
lonMax : -121.7997
lonMin : -121.8003
place 2:
latMax : 39.7559
latMin : 39.755
lonMax : -122.1988
lonMin : -122.1992
Run Code Online (Sandbox Code Playgroud)
我能够毫无问题地访问对象,这是我用来读取Firestore上的文档的功能:
import UIKit
import FirebaseFirestore
import Firebase
import CoreLocation
class SecondViewController: …Run Code Online (Sandbox Code Playgroud)