What he’s talking about are “resource” types. I don’t think I’ve ever used “store” archetypes and to be honest never really thought about my other stuff in strict terms… so I’m not sure I can help.
so to me, it appears that “store” is a sub-collection.
so could be the “friends” list or “posts”:
`/users/{id}/friends`
`/users/{id}/posts`
so that a user can add/remove his friends or posts on his own.
So here rise another question to me, when I have REST endpoints that look like
`/users/{id}/friends`
`/users/{id}/posts`
from a REST JSON model perspective does this indicate that “friends” and the “posts” collections should be embedded fields inside the “users” collection or there is no such rule?
“store” as explained seems more like “bookmarks” in the sense that the user will not create these resources only associate them with the store. So friends, yes. Posts, probably not since that is a resource controlled elsewhere. “favoritePosts”, yes.
then does it mean that I should embed friends and posts
into my User document (in MongoDB) like this?
{
"userId":"xxxxxx"
"userName":"MyName"
"email":"myname@yahoo.com"
"encryptedPassword":"xxxxxxxxx"
"friends": [] // List of friends Id ref
"posts": [] // List of Post objects
}