I often have to take screenshots of my WordPress themes and other products, and the look better when they have a browser frame around it. For this I open chrome without address bar and use the Mac OSX shortcuts CMD+Shit+4 + Spacebar to take the window screenshot with nice shadow. Here are the commands to
Archives for
CodeSnippets
Get the number of documents in a MongoDB collection with unique/distinct values for a field
Some times we need to get the number of documents with a distinct/unique value. An example use case is in the classic blog example. Get the number of authors with at least one post. Get the number of distinct tags/categories You can use the following commands to get the answers for the above questions db.posts.distinct(‘author’).length