Accessing the underlying Mongoose object

default discord avatar
devperson
12 months ago
2

There doesn't seem to be a way to do this -- will this ever be possible?



Would be useful to get the database connection to do more complex aggregations for instance

  • discord user avatar
    jmikrut
    Payload Team
    12 months ago

    You can do it!



    payload.collections[collectionSlug].Model
  • default discord avatar
    devperson
    12 months ago

    oh nice, thanks!

Open the post
Continue the discussion in Discord
Like what we're doing?
Star us on GitHub!

Star

Connect with the Payload Community on Discord

Discord

online

Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.