Closed bwgjoseph closed 3 years ago
The way create works today is not that it does a select, it basically appends the Id that gets returned back upon save to the document that you had passed in to return the whole document back.
Probably for your use case you might want to call findById with the select options passed in after create. I will keep this in our backlog as an item to discuss and probably revisit this after we go GA. At present I see this as a nice to have.
Calling findById
after create
is actually 2 separate calls which I hope to avoid. Keeping this as a backlog is fine at this moment, as I don't have a very strong use-case yet
However, for the 2nd part of the question is why does it other *ById
methods don't allow the options like findById
to pass in like select
?
@bwgjoseph on your last comment 2nd part I think we already discussed it here on the first part of the question, provide ability to select from a create. Can you close this ticket and create a new one and tag it as Backlog please ? It will keep the ticket cleaner for future reference
Hi,
Possible to consider supporting options for
create
? At the moment, I have a use case to return selected fields after creation.As for
createMany
, this would be dependent on #68, ifcreateMany
extension gets supported, then I think it should also support options`If this is accepted, then we maybe need to think if
update/replace/remove
etc should also provide such option as wellThanks
To further add on to this,
findById
supports passing inoptions
which includesselect
option, and hence, I could doBut the rest of the
*ById
methods does not provide theoptions
to do so