title: How to write a query in MongoDB to get data for last 7 days on rolling basis
body: <p>I am trying to build a MongoDB query to get last 7 days data on rolling basis. Can you help me how to write query to fetch data on dynamic dates.</p>