Closed weiztech closed 3 years ago
I found the model missing DocumentReference
on filter/query.
tried using firestore
directly, on get/query User
it always return the DocumentReference
,
then it can be use to query reference type
on Address
.
is it possible to get DocumentReference
on the query/get User
model ?
found it user_instance._meta._referenceDoc
, it would be great if the _reference
available on instance
class.
but it seems not thread safety to use the property directly, please correct me if I'm wrong.
Thanks for this effort but I think adding document reference
is not good usually when you have to store it and retrieve it back when needed. Mostly when you create cursor
it's hard to store doc ref
instead of this we have to use the key
which is a str
easy to store and all most in all cases we are using key
to save
, update
and delete
etc.
And I think it is easy to use key
you can do it like you want before
Address.collection.filter(user=user.key).get()
I fixed this in new version v.1.3.7
just check the update and its looks better this way 👍 . Thanks for the fix.
I checked on firestore the reference field value is
key
oruser.key
tried to query like below but not working.Address.collection.filter(user=user.key).get()