New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
馃殌 Feature: Add $databaseId to documents #3484
Comments
Come to think of it, and more simply, couldn't a |
Same question, its nice that you've complicated solution with multiple DBs, but without ENV containing DbId, you've also forced hardcoding this value in functions. |
With that, can we look at collection response? We currently return |
Whether or not |
I'd prefer |
This got implemented and released with Appwrite 1.0.0 馃コ Thank you for your contribution 馃檹馃徎 You can read more here. |
馃敄 Feature description
Not 100% sure if there currently is a way to deal with this (or what is the right way, this might not be a feature and rather an issue) however...
If we have a function that listens 3 levels deep on a database, all being wildcards for e.g:
databases.*.collections.*.documents.*.create
The idea is to be able to access the event data of which currently we can for the collection ID and document ID since that data is embedded, but not in the case of database ID. Is this an oversight or?
When using wildcards, obviously this event data is unknown until the event occurs therefore, we'd want to filter it not partially, but to include all properties that have wildcards on them, including database ID.
Since the introduction of
databases
in0.15.0
- The only way I've seen to access the database ID for an event is on theAPPWRITE_FUNCTION_EVENT
env var where the string looks like this:databases.DATABASEID.collections.COLLECTIONID.documents.DOCUMENTID.create
I'm performing a string split on this to extract the databaseId but this feels super clunky, let alone whether it's a trustable source?
I asked on Discord and it was mentioned to use a hard coded const in the code of the function. But then what would be the point of listening to events with wildcards if we can't filter that data? The database ID simply cannot be known and since we now have the ability to have multiple databases, we should be able to filter that too.
馃帳 Pitch
A more official way to access the database ID on function events.
馃憖 Have you spent some time to check if this issue has been raised before?
馃彚 Have you read the Code of Conduct?
The text was updated successfully, but these errors were encountered: