async function removePost (userId, postId) {
  try {
    await
    userModel
      .findByIdAndUpdate(userId, { $pull: { posts: postId } })
      .exec()
  } catch (error) { console.error(error) }
}
/*  find the user with the userId in DB
    and remove the postId from the posts array */
find the user with the userId in DB
and remove the postId from the posts array
find the user with the userId in DB and remove the postId from the posts array
async function removePost (userId, postId) {
  try {
    await
    userModel
      .findByIdAndUpdate(userId, { $pull: { posts: postId } })
      .exec()
  } catch (error) { console.error(error) }
}
async function removePost ( userId , postId ) { try { await userModel . findByIdAndUpdate ( userId , { $pull : { posts : postId } } ) . exec ( ) } catch ( error ) { console . error ( error ) } }
find the user with the userId in DB
and remove the postId from the posts array
find the user with the userId in DB and remove the postId from the posts array