I'm a beginner in Sitecore. I need to generate the data which provides how many times the user clicks a button on the webpage. The data should be stored on MongoDB database. I'm confused with where to start and how to. Suggest some references or samples to continue.
You could take a look at existing SBOS modules: https://marketplace.sitecore.net/Modules/S/SitecoreSBOSLinkTracker.aspx?sc_lang=en
This module extends the Link Manager to add a capability to set a link click to trigger a Page event.
The page events end up in the Sitecore Analytics and can be used for your reporting.
Another option is to write custom code. I wrote a blog post a while back about integrating AddThis with a custom goal (replace the addthis with you button and you have a possible solution).
If feasable, I would go for the SBOS module though. Will be more flexible..
NOTE: The SBOS Modules, while they work, can be buggy, depending on the needs of your solution. So make sure you test appropriately before deploying to a production environment.