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

$mod more strict about params

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical - P2
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 01112017-cleanup
    • Component/s: None
    • Labels:
    • Environment:
    • # Replies:
      1
    • Last comment by Customer:
      true

      Description

      Problem:
      The behaviour of $mod operator has changed from 2.4.x to 2.5.x.

      Impact:
      Backward breaking change

      Reproduce:
      2.4.5

      db.q.drop();
      db.q.insert({ni: {d:20}})
      db.q.find({"ni.d": {$mod: [5]}})
      { "_id" : ObjectId("525dcfbc9acd59e2720c38aa"), "ni" : { "d" : 20 } }
      db.q.find({"ni.d": {$mod: [5,0]}})
      { "_id" : ObjectId("525dcfbc9acd59e2720c38aa"), "ni" : { "d" : 20 } }
      db.q.find({"ni.d": {$mod: [5,0,1]}})
      { "_id" : ObjectId("525dcfbc9acd59e2720c38aa"), "ni" : { "d" : 20 } }

      2.5.3-pre

      db.q.drop();
      db.q.insert({ni: {d:20}})
      db.q.find({"ni.d": {$mod: [5]}})
      error: {
              "$err" : "bad query: BadValue malformed mod, not enough elements",
              "code" : 16810
      }
      db.q.find({"ni.d": {$mod: [5,0]}})
      { "_id" : ObjectId("525dd042e92d3da1f88a3311"), "ni" : { "d" : 20 } }
      db.q.find({"ni.d": {$mod: [5,0,1]}})
      error: {
              "$err" : "bad query: BadValue malformed mod, too many elements",
              "code" : 16810
      }

      )

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since reply:
                6 years, 9 weeks, 1 day ago
                Date of 1st Reply: