-
|
I'm evaluating the I'm having difficulties defining a type and schema for the change event model.watch('change', (change: ChangeEventType) => {
// save to history collection ...
})export default interface ChangeEventType {
_id: {
_data: mongoose.Types.ObjectId
}
operationType: string
clusterTime: Date
ns: {
db: string
coll: string
}
documentKey: Object
fullDocument: ClimbType | AreaType
}Sample change event What is the correct type definition for Errors: |
Beta Was this translation helpful? Give feedback.
Answered by
vkarpov15
Jul 17, 2022
Replies: 1 comment
-
|
See MongoDB docs here: https://www.mongodb.com/docs/manual/reference/change-events/ |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
vnugent
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See MongoDB docs here: https://www.mongodb.com/docs/manual/reference/change-events/
_id: { _data: string }andclusterTime: mongodb.Timestampshould be the correct types