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

Incorrect function on new Materialized View documentation page.

    XMLWordPrintableJSON

Details

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

    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
            Jess Mokrzecki Jess Mokrzecki
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              3 years, 49 weeks, 6 days ago