#MongoDB Action for Payload CMS UI Access

12 messages · Page 1 of 1 (latest)

hallow badgeBOT
#

Does anyone know what db action is used in mongodb when accessing collection items in the payload CMS user interface? I thought of “find” - and that’s the right thing to do when you call up the API, but not for the user interface

cyan crestBOT
#

Original message from @tidal coral - Moved from #general message

#
fleet widget
#

Hey @tidal coral

Not too sure I follow here - can you walk me through exactly what you're looking for? The Admin UI definitely takes advantage of the find operation, and it's db agnostic

tidal coral
# fleet widget Hey <@1066419569822011442> Not too sure I follow here - can you walk me throug...

Sure. Thanks for your time.

According to here: #1366738555975635035 message I try to create a “virtual” collection.

I am currently modifying the Mongoose adapter so that when something from the "virtual" collection is needed, I have my own logic.

For my little MVP, this works for a specific item with "findOne", "find" also works when opening the collection api. But the UI still doesn't show the actual items or try to get the data with "find".

fleet widget
#

I see...

Hmm, I don't think you can just swap the collection out for a "virtual" one like that simply. The list view renders out a table on the server using things like a collection config and other data. I personally think it might actually be easier to use a custom list view

tidal coral
fleet widget
#

Correct

#

It's more work than just replacing a singular data source to try to hook into the existing way I think

tidal coral
fleet widget
#

It does, but it doesn't just do a singular find and then display - it renders a table on the server and uses other properties like collection config to construct it