Uploaded image for project: 'Compass '
  1. Compass
  2. COMPASS-2874

$replaceRoot stages give an "Expected "[" or AggregationStage but "{" found." even on valid syntax

    • Sprint Vanilla Ice

      $replaceRoot Stage throws error event on correct syntax as below

      gaurav> db.produce.aggregate( [{$replaceRoot: { newRoot: "$in_stock" }} ] )
      

      But works well with this syntax:

      gaurav> db.produce.aggregate( [    {      $replaceRoot: { newRoot: {newRoot:"$in_stock"} }    } ] )
      

      See attachments for details.

        1. Error with correct syntax.png
          860 kB
          Gaurav Gupta
        2. Works fine with this syntax.png
          852 kB
          Gaurav Gupta

            Assignee:
            durran.jordan@mongodb.com Durran Jordan
            Reporter:
            gaurav.gupta@mongodb.com Gaurav Gupta
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: