0% found this document useful (0 votes)
4 views1 page

Queries

The document provides MongoDB queries to check ride statuses (InProgress, Completed, Canceled) and filter by customer or driver names and emails within a specific date range. It also includes PostgreSQL queries to retrieve rides and driver shifts based on a date filter. The examples demonstrate how to structure the queries for effective data retrieval.

Uploaded by

DAUD ALI
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views1 page

Queries

The document provides MongoDB queries to check ride statuses (InProgress, Completed, Canceled) and filter by customer or driver names and emails within a specific date range. It also includes PostgreSQL queries to retrieve rides and driver shifts based on a date filter. The examples demonstrate how to structure the queries for effective data retrieval.

Uploaded by

DAUD ALI
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Frequently Used Support Queries

MongoDB:
 To check the rides InProgress “Status”:2, Completed “Status”:3, Canceled “Status”:4
{
"Status":2,
"RequestTime": {
"$gte": ISODate("2024-10-18T00:00:00.000Z"),
"$lt": ISODate("2024-10-19T00:00:00.000Z")
}
}

 To check by Customer and Driver name

{
"Driver.Name":"RAZAKARIASA Tojoniaina",
"RequestTime": {
"$gte": ISODate("2024-10-18T00:00:00.000Z"),
"$lt": ISODate("2024-10-19T00:00:00.000Z")
}

{
"Customer.Name":"Seta customer ",
"RequestTime": {
"$gte": ISODate("2024-10-18T00:00:00.000Z"),
"$lt": ISODate("2024-10-19T00:00:00.000Z")
}
}
 with email
{
"Customer.Email":"[email protected]",
"RequestTime": {
"$gte": ISODate("2024-10-18T00:00:00.000Z"),
"$lt": ISODate("2024-10-19T00:00:00.000Z")
}
}
{
"Driver.Email":"[email protected]",

"RequestTime": {
"$gte": ISODate("2024-10-18T00:00:00.000Z"),
"$lt": ISODate("2024-10-19T00:00:00.000Z")
}
}

PostgreSQL
 To check the rides with date filter

SELECT * FROM public."Rides"


where "action_at" :: date = '2024-10-21'

 To check the driver shift created or not with current date filter

SELECT * FROM public."Shifts"


where "createdAt" :: date = '2024-10-21'

You might also like