-
Notifications
You must be signed in to change notification settings - Fork 0
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
Amazing populate hook! several questions: #1
Comments
|
Thanks very much for looking at the design. To answer some of your questions:
You are correct that its not clear. The name of the object containing
The construct resulting from
Correct.
True. I expect
Its the parent item to which we are wanting to join child items.
I added a section describing populate's permissions to the README. Please let me know if anything unclear.
I'm used to: to serialize an object means to convert its state to a byte stream so that the byte stream can be reverted back into a copy of the object. However the Feathers team is comfortable also using it to mean extracting desired data from an object, though in our case it means removing unwanted data.
Correct. Its not uncommon to combine the two needs in cases like this. However we felt there were conceptual and control benefits in separting them.
Agreed. Placing values in What do you think of using
+1. That's already covered as the signatures are Items outside a hook can be populated by calling the functions with a temporay hook object. |
Thank you for the explanations. I still don't get how I think Currently only It would be wonderful if besides |
I agree with you. I suggest you create an issue for it in feathers-client. |
But just one question: when
nameAs
is absent, where to place the populated items in the parent? Say:Here we get from service
users
an item whoseid
is the parent'sauthor
, and in which field do we put this item in the parent? The doc didn't seem to make this clear.select
andquery
in the following part?I understand the
select
function returns an object that would be added into thequery
object, so basically the two are one thing, only thatselect
is a function that acceptinghook
andparent
as parameters so it is dynamic, butquery
is static. Is this right?If so, I don't think it's necessary to make it into two different settings. We could only have one setting, say,
query
, and allowquery
to be either a static object or a function that dynamically returns an object using runtime data.BTW, what does
parent
mean inselect: (hook, parent) => ({ something: { $exists: false }})
? the parent service in the poplulation schema?I am not familiar with
feathers-permissions
so I didn't get how the permissions work. Any more examples?I am not very sure what
serialize
means here, either, since this term is never officially introduced in feathers docs. I foundserializers
are excluding things from the result butpopulaters
are adding things into the result. Is that right?It's wonderful that the client side could determine which popluation schema should be used in a
find
opeartion. But the folloing syntax seems not very pretty:The
_clientParams
doesn't look nice with an underscore ahead. Maybe better to use something like$params
. I understand currently onlyquery
is sent back to server, so it is a pity that we are not able to make it look nice like this:But even embedded in
query
we still be able to make it look nicer like this:The text was updated successfully, but these errors were encountered: