title: mongoose - update a updatedAt field while creating a new document
body: <p>I have the following code snippet.</p>
  <pre><code>const user = await User.findOne({ email: ownerData.email })
              .select('-_id -__v -updatedAt')
              .lean();
          if (!user) {
              throw new HttpException(404, 'User not found');
          }
          await User.deleteOne({ email: ownerData.email });
  
          console.log(user);
  
          const newUser = await User.create({
              ...user,
              ...{
                  address: ownerData.address,
                  city: ownerData.city,
                  state: ownerData.state,
              },
              _id: ownerId,
          });
          await newUser.save();
  </code></pre>
  <p>so basically what I want to do is delete the old user that is already present create a new one with the details of the old one. But unfortunately even though I am not taking the old <code>updatedAt</code> field, the old <code>updatedAt</code> field is getting populated on the new user object doc as well.</p>
  <p>There is a chance that the ownerId can be the same as the old _id. I believe it's because of that, but I don't get around this problem.</p>
  <p>Thanks</p>
  <h2>EDIT</h2>
  <p>I got another interesting lead on this problem.</p>
  <p>Since I am considering <code>createdAt</code> at the very first line of code</p>
  <pre><code>const user = await User.findOne({ email: ownerData.email })
              .select('-_id -__v -updatedAt')
              .lean();
  </code></pre>
  <p>The new doc is taking the time from this <code>createdAt</code> field. Once I removed and checked the newUser is being created at a new time. Is there any relationship between <code>createdAt</code> and <code>updatedAt</code> ?</p>