-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
None
-
Affects Version/s: 3.6.5
-
Component/s: Aggregation Framework
-
None
-
ALL
-
- I want to update the equivalent of a foreign key field that has an ObjectId string value with the ObjectId itself. I have tried using the aggregation $addFields and have discovered that ObjectId("$hexStringField") errors with:
Failed to execute script.
Error: invalid object id: length :
@(shell):2:26
- I suspected that there might be a problem using Object constructor methods so I tried using $addFields with UUID("$uuidStringField") and Date("$dateField").
Using these methods did not produce an error, but did not give the expected results.