Details
-
Bug
-
Resolution: Fixed
-
Minor - P4
-
None
-
Fully Compatible
-
ALL
-
v3.6, v3.4, v3.2
Description
$pow has issues where a NumberLong base of -1 is used with a NumberLong exponent of a negative odd value.
For example:
MongoDB Enterprise > db.v.aggregate({$project: {'a': { $pow: [ NumberLong(-1), NumberLong(-5) ] }, 'b' : { $pow: [ -1, NumberLong(-3) ] } } })
|
{ "_id" : ObjectId("5a689c791de68d211f6234d6"), "a" : NumberLong(1), "b" : -1 }
|
Removing the NumberLong from either argument causes the right answer. It seems to be related purely to the return type being NumberLong, though I can confirm there are no issues with positive odd exponents.
Attachments
Issue Links
- links to