-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Amplify datastore is not supporting multitenant #5222
Comments
So something like this: const subscription = DataStore.observe(Post, 123).subscribe(msg => { So we only listen to Posts with id 123 |
A better requirement description: tell datastore to only get data locally from a certain model with a certain ID |
Could you give more specific information about the use case? |
I have this schema. The idea is to build an online quiz. But if you look in de localstorage you see all the quiz data and questions ` type Questions @model @auth(rules: [{ allow: public, provider: iam }]) { type Subscribers @model @auth(rules: [{ allow: public, provider: iam }]) { type Responses @model @auth(rules: [{ allow: public, provider: iam }]) { ` |
It is possible to observe one object like so: const id = '69ddcb63-7e4a-4325-b84d-8592e6dac07b';
const subscription = DataStore.observe(Event, id).subscribe(msg => {
console.log(msg.model, msg.opType, msg.element);
onQuery();
}); This also came up here: https://github.com/aws-amplify/amplify-js/issues/5156 |
Ok cool, so then only that data will be locally in the store and not the other data. Thx |
Is tracked here: #5119 |
Observing a model is different than loading all the models. If you're looking to just load specific ones that's handled by the feature #5119 |
Resolving this issue in favor of the open feature request that is open |
This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs. Looking for a help forum? We recommend joining the Amplify Community Discord server |
The observe is listening to all model data, but it is not possible to only listen to specific data on the model and then apply specific queries and filters on that data.
The text was updated successfully, but these errors were encountered: