title: PUSH id in order like add to cart
body: <p>I created model schema for users and products with simple CRUD, my next project is my model schema order where I push my userId and projectId in the array in order.</p>
  <p>this is the code that I created in the controller</p>
  <pre><code>module.exports.makeOrders = (reqBody) =&gt; {
  
  let newOrder = new Order({
      totalAmount : reqBody.totalAmount,
      usersOrder.push({
          userId : reqBody.userId,
          project : reqBody.projectId
      }),
  })
  
  return newOrder.save().then((order, error) =&gt;{
      if(error){
          return false;
      }
      else{ 
          return true;
      }
  })
  }
  </code></pre>
  <p>and this is my route</p>
  <pre><code>router.post(&quot;/checkout&quot;, (req, res) =&gt; {
  let data = {
      userId : req.body.userId,
      productId : req.body.productId
  }
  userController.makeOrders(data).then(resultFromController =&gt; res.send(resultFromController))
  })
  </code></pre>
  <p>this is my model</p>
  <pre><code>const orderSchema = new mongoose.Schema({
  totalAmount : {
      type : Number,
      required : true
  },
  purchasedOn : {
      type : Date,
      default : new Date
  },
  usersOrder :[
                  {
                      userId : {
                          type : String,
                          required : true
                  },
  
                      productId : {
                          type : String,
                          required : true
                  },
              }
          ]
      })
  </code></pre>
  <p>this is what I enter in postman</p>
  <pre><code>{
  &quot;totalAmount&quot; : 1000,
  &quot;userId&quot; : &quot;62a9c46c4d15dc8157c375aa&quot;,
  &quot;productId&quot; : &quot;62aafe01d9337ce87ff5aaa1&quot;
  }
  </code></pre>
  <p>the error that I'm experiencing is &quot;SyntaxError: Unexpected token '.' &quot;
  based on what I know I put the push method in the wrong place. I just copy the create method in the user which is working. I don't know why it is not working in order controller.
  Note. I just started to learn json.</p>