Kanha Help Me

update data by id in mongoose

try { let users = await User.updateOne({ _id: req.params.id }).set({ email: ‘hhihhhjih@drtgt’ }); return res.status(200).json( { success: true, data: users } ); } catch (error) { return res.status(400).json( { success: false, message: error.message } ); }

What is the “__v” field in Mongoose – remove that field

 const mongoose = require(‘mongoose’); const userSchema = new mongoose.Schema({ username: { type: String, // required: true, // unique: true }, email: { type: String, // required: true, // unique: true }, password: { type: String, }, firstname: { type: String, }, lastname: { type: String, }, address: { type: String, }, mobile: { type: String, …

What is the “__v” field in Mongoose – remove that field Read More »

How to install Laravel globally in Ubuntu

 =================================================================== Open your terminal using Ctrl+Alt+T and type the following commands Step 1: Install Laravel composer global require “laravel/installer” Step 2: Add composer to path to access laravel globally export PATH=”~/.config/composer/vendor/bin:$PATH” Step 3: Create a new Laravel application laravel new blog Step 4: Install missing packages and their dependencies cd blogcomposer install Step 5: Test the application …

How to install Laravel globally in Ubuntu Read More »