Open mg3146 opened 1 year ago
I'm not an expert, but I don't think there is a more efficient way(if that's what you're looking for), unless you keep a list of document IDs manually: you can prefetch list of all documents at the start of the application, save IDs to the list and then set up even-based actions to updated that list.
To answer your question... you can get the document using it's reference ID. i.e.
Document.get(link.ref.id)
You can also search for document and use count
method.
https://beanie-odm.dev/api-documentation/query/#findonecount
Would be something like
Document.find_one(link.ref.id).count() == 1
Hi,
Is there an efficient way to check if a link is still valid without having the fetch the linked document ?
Thx.