@quihan, Thank You
Well, alright… its an example use-case & My script connects to Mongo & does the following:
- There is data in a collection called “UserSession” & there’s multiple documents like these:
{
“_id” : ObjectId(“5b59b7ce1f44538037784e6d”),
“URL” : “https://docs.mongodb.com/manual/mongo/”,
“Session_Id” : “1236544hhhj”,
“Cookie_Id” : “411lok”,
“Previous_URL” : “https://www.google.com/”,
“createdAt” : ISODate(“2018-08-07T12:00:14.735+0000”)
}
So for the first case, the query –
resultCount = len(collection.distinct(“Session_Id”))
print(resultCount)
needs to give me a count of unique IDs & it’ll return a number which i want returned in UiPath.
- The next use-case is to retrieve the count of records where the field “Previous_URL” has the pattern google & this data is to be fetched from yesterday’s date… all that is implemented. So second case gives me another count in the database.
These are 2 expected integer values i need
Please do let me know if any other detail is needed too.