title: How I can insert to MongoDB using Rest API with Javascript?
body: <p>I am trying to insert the record into my mongoDB. Here is what I tried:  </p>
  
  <pre><code>  $.ajax({
                    type: "POST",
                    url: "http://localhost:28017/messages_sent/better/?doc=",
                    data: {
                          thread_id: event.threadID,
                          message_id: event.messageID,
                          user_email: sdk.User.getEmailAddress(),
                token: token
                      },
                    dataType: "JSON"
                  });
  
            countUsage();
            chrome.storage.sync.set({ "last_tracked_email_date": Date.now() });
            alert("hello");
          }
        });
  </code></pre>
  
  <p>I am trying to look into the MongoDB, but could not find any thing in the database.<br>
  How I can insert the record into MongoDB using javascript and Rest API of MongoDB itself?</p>