If you are a beginner to MongoDB, writing queries using pipelines could be a little tricky. I personally took some time to understand how each part in the pipeline works and how to write them effectively. In this article, I present a few examples of writing queries with pipeline by explaining each query in detail. Let's take a collection of documents where each document tracks articles written by different authors on different categories. Each document tracks the task ID assigned to the author for tracking his/her progress and the articles written by him/her with the status of each article whether completed or pending. We have various authors writing different articles on categories like devops, testing, etc. Here, we store the document in the collection based on category and article status. The example structure is as below.


I guess you came to this post by searching similar kind of issues in any of the search engine and hope that this resolved your problem. If you find this tips useful, just drop a line below and share the link to others and who knows they might find it useful too.

Stay tuned to my blogtwitter or facebook to read more articles, tutorials, news, tips & tricks on various technology fields. Also Subscribe to our Newsletter with your Email ID to keep you updated on latest posts. We will send newsletter to your registered email address. We will not share your email address to anybody as we respect privacy.


This article is related to


database,tutorial,mongodb,json,database tutorial,mongodb tutorial