[DOCS-2092] $mod more strict about params Created: 15/Oct/13  Updated: 11/Jan/17  Resolved: 17/Oct/13

Status: Closed
Project: Documentation
Component/s: None
Affects Version/s: None
Fix Version/s: 01112017-cleanup

Type: Bug Priority: Critical - P2
Reporter: Alvin Richards (Inactive) Assignee: Kay Kim (Inactive)
Resolution: Done Votes: 0
Labels: 26qa, nqf
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

> db.serverBuildInfo()
{
"version" : "2.5.3-pre-",
"gitVersion" : "1ea7e56cb2b8653d4b0453f04728033df34be9e1",
"OpenSSLVersion" : "",
"sysInfo" : "Darwin vero 12.5.0 Darwin Kernel Version 12.5.0: Sun Sep 29 13:33:47 PDT 2013; root:xnu-2050.48.12~1/RELEASE_X86_64 x86_64 BOOST_LIB_VERSION=1_49",
"loaderFlags" : "-fPIC -pthread -Wl,-bind_at_load",
"compilerFlags" : "-Wnon-virtual-dtor -Woverloaded-virtual -fPIC -fno-strict-aliasing -ggdb -pthread -Wno-unknown-pragmas -Winvalid-pch -pipe -O3 -Wno-unused-function -Wno-deprecated-declarations -mmacosx-version-min=10.6",
"allocator" : "tcmalloc",
"versionArray" : [
2,
5,
3,
-100
],
"javascriptEngine" : "V8",
"bits" : 64,
"debug" : false,
"maxBsonObjectSize" : 16777216,
"ok" : 1
}


Issue Links:
Related
Participants:
Days since reply: 10 years, 17 weeks, 6 days ago

 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
}

)



 Comments   
Comment by auto [ 17/Oct/13 ]

Author:

{u'username': u'kay-kim', u'name': u'kay', u'email': u'kay.kim@10gen.com'}

Message: DOCS-2092 modulo operator
Branch: master
https://github.com/mongodb/docs/commit/bd0943a2e19b3f0cf206a9e66e47518f86d5c9b2

Generated at Thu Feb 08 07:42:38 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.