Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-12824

Incorrect function on new Materialized View documentation page.

    XMLWordPrintable

Details

    • Typo
    • Status: Resolved
    • Minor - P4
    • Resolution: Fixed
    • 4.2.0-rc0
    • None
    • Rel Notes
    • true

    Description

      Description

      The new Materialized View documentation page references a possibly-deprecated function.

      https://docs.mongodb.com/master/core/materialized-views/

      The Materialized View Definition example below will not allow the Perform Initial Run step to run against 4.2 server until 'replaceWithNew' is replaced with simply 'replace':

      updateMonthlySales = function(startDate) {
      db.bakesales.aggregate( [
      { $match: { date:

      { $gte: startDate }

      } },
      { $group: { _id: { $dateToString:

      { format: "%Y-%m", date: "$date" }

      }, sales_quantity: { $sum: "$quantity"}, sales_amount: { $sum: "$amount" } } },
      { $merge: { into: "monthlybakesales", whenMatched: "replaceWithNew" } }
      ] );
      };

      Scope of changes

      Impact to Other Docs

      MVP (Work and Date)

      Resources (Scope or Design Docs, Invision, etc.)

      Attachments

        Activity

          People

            kay.kim@mongodb.com Kay Kim (Inactive)
            jneedham@travelers.com Jeff Needham
            Kay Kim Kay Kim (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              3 years, 1 week, 1 day ago