You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In non-atomic databases like CouchDB storing all users in the same DB record can lead to lost favorites due to race conditions.
What would be better is for these types of database is to store each individual like as a separate record. That way you don't run into this issue as much.
We might have to rename likes in the mixin configuration to something more descriptive.
Options
Type
Requried
Possible Values
Examples
likesModel
String
No
Model name
Like, Favorite, etc. can not be used together with likesAttribute
likesAttribute
String
No
Any
Model property name with Object type when not using likesModel
The text was updated successfully, but these errors were encountered:
@Juice10 thanks for reaching out, hey so... yes I thought at some point in doing that is just that I haven't used this module in a while, therefore I have been unable to improve it.
I usually keep improving and making bigger modules that my current projects requires, but unfortunately this has not been a requirement in a while, so.... If you are able to send a pull request adding this feature would be cool, otherwise I would need to find some time at some point to implement that.. But not sure it will be like really soon..
@jonathan-casarrubias Thanks for the response!
Because of the CouchDB requirements I had I ended up creating a Like model and adding it as a relation to my models like so:
It seemed like the easier way to do it than rewriting loopback-likes-mixin since I don't have that much experience writing loopback mixins as of now. I really do like the plugin you created and love the ease of use setting it up.
In non-atomic databases like CouchDB storing all users in the same DB record can lead to lost favorites due to race conditions.
What would be better is for these types of database is to store each individual like as a separate record. That way you don't run into this issue as much.
We might have to rename
likes
in the mixin configuration to something more descriptive.likesAttribute
likesModel
The text was updated successfully, but these errors were encountered: