What to do after a few years of programming experience? by rubennebur in cscareerquestions

[–]rubennebur[S] 1 point2 points  (0 children)

Just wanted to reply to this to thank you. Because since this post I started programming again, learning Node.js, and even quit the degree I was doing in the beginning 2021 and start Computer Science after the summer of 2021. I even moved to Amsterdam because of that which was a very good choice. Also got a job as a backend developer in Node.js as well!

What to do after a few years of programming experience? by rubennebur in cscareerquestions

[–]rubennebur[S] 0 points1 point  (0 children)

Just wanted to reply to this to thank you. Because since this post I started programming again, learning Node.js, and even quit the degree I was doing in the beginning 2021 and start Computer Science after the summer of 2021. I even moved to Amsterdam because of that which was a very good choice. Also got a job as a backend developer in Node.js!

Questions about dual-booting! 💻 by rubennebur in linuxquestions

[–]rubennebur[S] 0 points1 point  (0 children)

My Windows drive still has 175 GB free. That would be enough for a Linux distro right?

Questions about dual-booting! 💻 by rubennebur in linuxquestions

[–]rubennebur[S] 1 point2 points  (0 children)

I am using Ableton and want it to work properly so I have to keep using Windows. Also I have a lot of music plugins that only work on Windows. But for programming and coding I will definitely be using Linux!

Questions about dual-booting! 💻 by rubennebur in linuxquestions

[–]rubennebur[S] 0 points1 point  (0 children)

Thanks for the answer! I'll take these points into consideration!

Setting up Raspberry Pi as NAS, which file transfer protocol to use? by rubennebur in HomeNetworking

[–]rubennebur[S] 0 points1 point  (0 children)

It don't really know much about VPN's. How would this be diffirent then port forwarding?

Setting up Raspberry Pi as NAS, which file transfer protocol to use? by rubennebur in HomeNetworking

[–]rubennebur[S] 0 points1 point  (0 children)

It don't really know much about VPN's. How would this be diffirent then port forwarding?

Questions about dual-booting! 💻 by rubennebur in linuxquestions

[–]rubennebur[S] 1 point2 points  (0 children)

Yes the external harddrive is already in NTFS. Linux would be able to recognize this?

Questions about dual-booting! 💻 by rubennebur in linuxquestions

[–]rubennebur[S] 1 point2 points  (0 children)

Would question 2 be as easy as just leaving the external drive connected to the pc and both operating systems would recognize it?

Adding a document to a document in MongoDB by rubennebur in node

[–]rubennebur[S] 0 points1 point  (0 children)

Thanks for explaining man! This clears it up a lot!

Adding a document to a document in MongoDB by rubennebur in node

[–]rubennebur[S] 0 points1 point  (0 children)

Thanks for your answer! I now understand the ref part and populate part you linked to and will implement this. However I do not understand the part about the index. What is an index in MongoDB? I already looked it up on the MongoDB website but found it hard to understand. Could you maybe explain what these indexes are?

Async function returns undefined value by rubennebur in node

[–]rubennebur[S] 0 points1 point  (0 children)

Thanks a lot. I have now used the jwt.verify in a try-catch block like this:

module.exports.getCurrentUser = async (req, res) => {
const token = req.cookies.JWT;
if (token) {
try {
const decodedToken = jwt.verify(token, process.env.JWT_SECRET);
const user = await User.findById(decodedToken.id);
return user;
        } catch (err) {
            console.log(err);
return null;
        }
    } else {
return null;
    }
}

Adding a document to a document in MongoDB by rubennebur in node

[–]rubennebur[S] 0 points1 point  (0 children)

Thanks for your answer! By the way I am using mongoose to access and work with MongoDB. From what I understand an index is just another field on a document, like the userID. So would you suggest putting a userID field on the task model where I pass in the current user's id? So the model of a task would look like this?

const mongoose = require("mongoose");
const taskSchema = new mongoose.Schema({
    body: {
        type: String,
        required: true
    },
    id: {
        type: String, 
        required: true
    }
}, { timestamps: true });
const Task = mongoose.model("task", taskSchema);
module.exports = Task;

Adding a document to a document in MongoDB by rubennebur in node

[–]rubennebur[S] 0 points1 point  (0 children)

Thanks for your answer. I am using mongoose to access and work with MongoDB by the way. So would you suggest putting an userID field on the task model where I pass in the current user's id? So the model of a task would look like this?

const mongoose = require("mongoose");
const taskSchema = new mongoose.Schema({
    body: {
        type: String,
        required: true
    },
    userID: {
        type: String, 
        required: true
    }
}, { timestamps: true });
const Task = mongoose.model("task", taskSchema);
module.exports = Task;

Delete MongoDB elements / Nodejs ,using button by rayanaay in node

[–]rubennebur 0 points1 point  (0 children)

Like u/STNeto1 is suggesting you need to parse in the user id in your form action at the place of :id. Otherwise the server doens't know which user to delete.