Skip to content

MongoDB aggregation commands #469

Answered by jmikrut
jokillinger asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @Salomo — with the Payload Local API, this is currently not possible. But, you can do this via one of two ways:

  • With Mongoose. You can access the Mongoose model that corresponds to your Payload collection via payload.collections[collectionSlug].Model. Then, you can do whatever you can do with Mongoose.
  • With raw MongoDB by writing Mongo queries directly against your database

Does this help you out?

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@jokillinger
Comment options

@DanRibbens
Comment options

@jokillinger
Comment options

@hifreaker
Comment options

@jokillinger
Comment options

Answer selected by jokillinger
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants