Use case

Ask your orders data
anything

Your orders collection already knows your revenue, best sellers and slow deliveries. Connect it read-only and ask wuup in plain English; it writes the aggregation, runs it safely and answers with a chart, a table and the query behind every number.

Who it's for

D2C founders, ops leads and analysts running a store on MongoDB

Sources

  • MongoDB orders
  • MongoDB customers
  • MongoDB products

The problem today

  • Revenue questions need someone who can write $unwind and $group.
  • Exports to spreadsheets go stale the day they're made.
  • Line items live inside arrays, which generic BI tools handle badly.

Six questions,
and what wuup does

Ask in plain English. Here is what happens behind each answer, including the query when there is one.

  1. 01

    What was revenue by month, excluding cancelled orders?

    Matches non-cancelled orders, groups by month and charts the totals.

    db.orders.aggregate([
      { $match: { status: { $ne: "cancelled" } } },
      {
        $group: {
          _id: { $dateToString: { format: "%Y-%m", date: "$createdAt" } },
          revenue: { $sum: "$total" }
        }
      },
      { $sort: { _id: 1 } }
    ])
  2. 02

    Which products sell the most units?

    Unwinds line items and sums quantity per SKU.

    db.orders.aggregate([
      { $match: { status: { $ne: "cancelled" } } },
      { $unwind: "$items" },
      { $group: { _id: "$items.sku", units: { $sum: "$items.qty" } } },
      { $sort: { units: -1 } },
      { $limit: 10 }
    ])
  3. 03

    Which orders have been pending for more than 3 days?

    Filters pending orders older than three days using $$NOW.

    db.orders.find({
      status: "pending",
      $expr: {
        $lt: [
          "$createdAt",
          { $dateSubtract: { startDate: "$$NOW", unit: "day", amount: 3 } }
        ]
      }
    }, { _id: 0, orderNumber: 1, total: 1, createdAt: 1 })
      .sort({ createdAt: 1 })
      .limit(50)
  4. 04

    What's the average order value by payment method?

    Groups non-cancelled orders by payment method and averages the total.

    db.orders.aggregate([
      { $match: { status: { $ne: "cancelled" } } },
      {
        $group: {
          _id: "$paymentMethod",
          avgOrderValue: { $avg: "$total" },
          orders: { $sum: 1 }
        }
      },
      { $sort: { avgOrderValue: -1 } }
    ])
  5. 05

    How many customers ordered more than once?

    Counts orders per customer, then counts customers with two or more.

    db.orders.aggregate([
      { $group: { _id: "$customerId", orders: { $sum: 1 } } },
      { $group: { _id: { $gte: ["$orders", 2] }, customers: { $sum: 1 } } }
    ])
  6. 06

    Which cities bring in the most revenue?

    Groups by the embedded shipping city and ranks by revenue.

    db.orders.aggregate([
      { $match: { status: { $ne: "cancelled" } } },
      { $group: { _id: "$shipping.city", revenue: { $sum: "$total" } } },
      { $sort: { revenue: -1 } },
      { $limit: 10 }
    ])

From question
to answer

  1. 1

    Connect orders, customers, products

    Scope wuup to just the collections it should read.

  2. 2

    Ask like you'd ask an analyst

    "Top 10 products by revenue last month, excluding cancelled orders."

  3. 3

    Drill down

    Use the follow-ups to split by city, payment method or customer.

Why it works
for this job

Handles line-item arrays

wuup unwinds embedded items when a question is about products, and leaves orders whole when it's about orders.

Joins customers and products

$lookup between the collections you enabled answers questions like "top customers by spend".

Targets from a sheet

Keep monthly targets in Google Sheets and ask for actual vs target in the same chat.

What changes

  • Daily revenue and product questions answered without a BI project.
  • Every number traceable to the query that produced it.
  • No risk to production data: read-only user plus a write-blocking guard.
How the connector works

Questions,
answered

Bring the data.
Ask the question.