How to provide the date and records

Hi Team,

Would you please let me know how to provide and fetch the date and records and each collection and/or multiple collections

Llooking for in Mongo query

Your requirement is not explicit enough.

What do you mean fetch the date?

If you get the records, then you get the dates stored in those records.

Post sample documents and expected results.

You may use https://www.mongodb.com/docs/manual/reference/method/db.getCollectionNames/ to get the list of collections.

Hi Steeve,

I mean, fetch date and records eg: yesterdate : how records stored like daybefore yesterday date : how many records stored as well as one month etc…

each collection dates are stored in records but how to fetch day wise how many records are stored.

Thanks

Still not clear enough.

You may find the date operators in the documentation.

To count documents you $group then $sum.

I am attaching here 2 records with date same like we have more than 1 lack records each collection with date also

below are the sample same like this i need records date wise
date : 2022-01-19T record :1
date: 2022-03-30T record: 2

/* 1 */
{
    "_id" : ObjectId("778mmm06f95901e0c001183977"),
    "recordublishIndicator" : "Y",
    "systemarrativeIndicator" : "N",
    "eventId" : "test",
    "eventName" : "test",
    "timeStamp" : ISODate("2022-01-19T04:27:37.197Z"),
    "eventMethod" : "test",
    "resourceName" : "test",
    "targetType" : "jack",
    "resourseUrl" : "",
    "operationName" : "test",
    "functionStatus" : "",
    "results" : "",
    "pageId" : "test",
    "ban" : "",
    "jobId" : "",
    "wrid" : "",
    "jobType" : "",
   
}

/* 2 */
{
    "_id" : ObjectId("6243f591d781ca99888erer8"),
    "recordPublishIndicator" : "Y",
    "systemNarrativeIndicator" : "N",
    "eventId" : "WTLASWA-02-13-007",
    "eventName" : "",
    "timeStamp" : ISODate("2022-03-30T06:15:45.014Z"),
    "eventMethod" : "API response",
    "resourceName" : "",
    "targetType" : "{\"version\":\"0.1.259\",\"userRole\":\"dc_te\"}",
    "resourseUrl" : "",
    "operationName" : "getLastReleaseNumber",
    "functionStatus" : "SUCCESS",
    "results" : "{\"flowStatus\":\"SUCCESS\",\"flowStatusMessage\":\"\",\"lastReleaseNumber\":\"0.1.259\",\"atlasUpgradeType\":\"F\"}",
    "pageId" : "",
    "ban" : "",
    "jobId" : "",
    "wrid" : "",
    "jobType" : "",

I hope you can understand good now

Publish your documents again after reading Formatting code and log snippets in posts so that we can cut-n-paste them into our system.

The following should give record:1

{ "timeStamp" :
   { "$gt" : new Date( "2022-01-19" ) ,
     "$lt" : new Date( "2022-01-20" ) 
   }
}