I have an attribute string array in a collection and lets say it contains Ids how can i check between 2 documents from that collection where they have same ids example doc 1 attribute "ids" [1423] [123] doc 2 [0005] [123] how would i find the mutual part wich is [123]
TL;DR
Summary: The developer is asking for help on how to find the common elements between two documents in a collection, specifically for an attribute that is a string array containing IDs.
Solution: To find the mutual part (common elements) between two documents in a collection, both containing a string array attribute with IDs, you can use the following approach:
1. Retrieve both documents from the collection.
2. Access the "ids" attribute in each document.
3. Convert the string arrays into sets for easy comparison.
4. Use the intersection operation to find the common elements between the two sets.
5. Convert the resulting set back to an array ifi guess i can do this by selecting the 2 documents and then checking client side
Recommended threads
- Why does this happen?
`AppwriteException: general_argument_invalid, Invalid `secret` param: Value must be a valid string and at least 1 chars and no longer than 256 chars (400)` the...
- Database Write Limits hit
Hello Appwrite Admins, I'm a GitHub Education user, and about a week ago, my database was really badly optimized, resulting in about 600k writes in a single day...
- How i can call increment with operators ...