I can connect to mongodb by mongoose in nodejs as below.
mongoose.connect('mongodb://127.0.0.1:27017/something', dbOptions, err => {
if(err) { return process.exit(1) }
someSchema.findOne({}, result =>{
if(!result) { someSchema.insert({some object}) }
return process.exit(0)
})
})
I can run this file on nodejs without problem.
But I want to run this file on lunux shell script. How can I make this concept on shell script? Could you give me some advice? Thank you so much for reading it.