Комментарии:
TypeError: Cannot read properties of null (reading 'redirectURL') , Anyone please help how to resolve it.
ОтветитьInteresting video, nice explanation Thanks
ОтветитьFOR THOSE WHO ARE STUCK AT entry.redirect not defined, try
entry["redirectURL"].... idk why but it works and that dont bruh.
Path is required like error can be solved by defining default:shortid() , in shortId: Schema
shortId: {
type:String,
unique: true,
default: shortid(),
required: true,
},
bhai I follow your same code and when i start npm the npm is running also but when i run send url from post man it always saying url is required please helpm me out
Ответитьmake a video on mongodb module in Nodejs
ОтветитьCode is not working
ОтветитьGot the solution for typeError: Cannot read properties of null (reading 'redirectURL') . You should add {shortid:shortId} as a json as 1st parameter in findOneAndUpdate() method instead of only {shortId} . Then it should work.
ОтветитьTypeError: Cannot read properties of null (reading 'redirectURL') , Anyone please help how to resolve it.
ОтветитьThank you for your great efforts! Really really awesome video.
ОтветитьFor those its not working because shortid has been depretiated. and if you still want to use it then install it by "npm i [email protected]". hopefully it would work.
Ответитьgetting error on postman get request "Cannot GET /url/8iN0AH5hG" also used yr source code but still getting issue how to fix can u help ?
ОтветитьJitne bhi logo ko error aa raha hai entry me to jaha await URL.findOneAndUpdate {} hai uss function ko variable name Dena hai const entry = await URL.findOneAndUpdate {} like this and please bhaiya ke videos aage aage karke mat dekha karo 😂😂
Ответитьawait is not working for res.redirect
can you please help
Getting null in findOneAndUpdate query
app.get('/:shortId', async (req, res) => {
const shortId = req.params.shortId;
const entry = await URL.findOneAndUpdate(
{
shortId
},
{
$push: {
visitHistory: {
timestamp: Date.now(),
},
},
}
);
console.log(entry); // getting Null value
how handlegenerateshorturl function get req and res objects?
Ответить