CodableFirebase icon indicating copy to clipboard operation
CodableFirebase copied to clipboard

Get full Firebase path for model

Open peterwarbo opened this issue 6 years ago • 1 comments

Let's say I have a model that looks like this:

struct Model: Codable {
    struct ModelB: Codable {
        let intBProperty: Int
    }

    let Int: intProperty
    let modelB: ModelB
}

How can I get the Firebase path to ModelB's int property? For instance "model/modelB/intBProperty" ?

It would be convenient to get the full Firebase path.

peterwarbo avatar Apr 29 '18 15:04 peterwarbo

Hi! Thanks for asking this question! TBH, I had some similar thoughts some day, but in a lot of scenarios, we don’t really need a full path... For example, if you have collections in Firestore. However, if you really use it a lot, I think it should be a separate library and it could be based on KeyPaths, for example. However, it’s just an initial thought

alickbass avatar May 21 '18 18:05 alickbass