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

Incorrect function on new Materialized View documentation page.

    • Type: Icon: Typo Typo
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 4.2.0-rc0
    • Component/s: Rel Notes
    • Labels:

      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.)

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

              Created:
              Updated:
              Resolved:
              4 years, 43 weeks ago