How can we use findAndModify #8588
Answered
by
paramanandbalara
paramanandbalara
asked this question in
Q&A
-
repository.findAndModify({ I want to create document if id not found then create a document by given id and if id found in database then increment seq by 1 |
Beta Was this translation helpful? Give feedback.
Answered by
paramanandbalara
May 11, 2022
Replies: 1 comment
-
let repo: any = Instance of repo;
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
paramanandbalara
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
let repo: any = Instance of repo;
const result: any = await new Promise((resolve, reject) => {
repo.dataSource.connector.execute(
'Counter', // collection name
'findAndModify', // command to execute
// additional arguments