skip to Main Content

Mongodb – I am not able to import a code from another file

I'm trying to import my code functions from one file to another, however, it's not working. Look at the file I'm exporting from: const uri = "mongodb+srv://<User>:<PassWord>@cluster0.ubhacr9.mongodb.net/?retryWrites=true&w=majority" const client = new MongoClient(uri); async function run(){ //code } async function inserirDatabase(tipo,…

VIEW QUESTION

Node Js: Remove string array element from mongoDB

I have a user schema as follows: const UserSchema = new mongoose.Schema({ skills: [String] }); module.exports = mongoose.model("User", UserSchema); And a Fetch request to delete a skill as follows: const deleteItem = async (id) => { try { await fetch(`http://localhost:5000/api/user/deleteskill`,…

VIEW QUESTION
Back To Top
Search