Open sscheetz opened 1 year ago
This has been identified as a feature request. If this feature is important to you, we strongly encourage you to give a 👍 reaction on the request. This helps us prioritize new features most important to you. Thank you!
Hi @sscheetz, I believe the Amplify.DataStore.delete(ModelType, condition) operation queries the local database given the condition, finds all rows that are to be deleted, queues them up as Mutation Events to the AppSync, and removes them locally. Your workaround would work in that it will pull the Queues into memory, and the local database will already have the Queues.
I can see that the problem here is that you can't specify a condition based on the queueSeeds
property, can you confirm that this is the feature request you're looking for?
Amplify.DataStore.delete(Queue.self, condition: Queue.keys.queueSeeds.someProperty.eqs(true))
Yeah this would be great, having the ability to query based on a condition of a embedded collection
Amplify.DataStore.delete(Queue.self, condition: Queue.keys.queueSeeds.someProperty.eqs(true))
Is your feature request related to a problem? Please describe.
I have a model that looks like
where queueSeeds is an EmbeddedCollection.
I would like to be able to delete rows in the cloud datastore based on if any of the queueSeeds have a certain property set to true, but it isn't possible to write a predicate for that.
I think there is a workaround of querying all Queues for the customer, filtering queueIds in memory, then deleting the correct queueIds but I don't want to fill up the local database with queues that aren't being deleted.
Describe the solution you'd like
I would like a way to build a predicate based on the EmbeddedCollection. I believe dynamo would support this query naturally.
Describe alternatives you've considered
Querying all Queues, filtering locally, deleting correct queueIds, but I don't want to fill the local cache with data that will never be deleted.
Is the feature request related to any of the existing Amplify categories?
DataStore
Additional context
No response