log command
This commit is contained in:
parent
69f48b83c4
commit
44df2e73f0
5
index.js
5
index.js
@ -32,8 +32,11 @@ mongoDBConnect().then(async (client) => {
|
|||||||
const db = await client.db(process.env.DB_NAME)
|
const db = await client.db(process.env.DB_NAME)
|
||||||
const collection = await db.collection(process.env.COLLECTION_NAME)
|
const collection = await db.collection(process.env.COLLECTION_NAME)
|
||||||
|
|
||||||
const answer = await collection[process.env.COMMAND](JSON.parse(process.env.ARGUMENT))
|
console.log('command', process.env.COMMAND)
|
||||||
|
console.log('argument', process.env.ARGUMENT, process.env.ARGUMENT.replace("ISODate()", new Date()))
|
||||||
|
|
||||||
|
const answer = await collection[process.env.COMMAND](JSON.parse(process.env.ARGUMENT.replace("ISODate()", new Date())))
|
||||||
|
|
||||||
await client.close();
|
await client.close();
|
||||||
return answer.ops?.[0] ?? answer
|
return answer.ops?.[0] ?? answer
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user