collection: {_id:0}
query: find( {}, {x: {$dateAdd: {startDate: "$date",unit: "second",amount: {$indexOfCP: ["foo", "$str", 0]},}}} )
Results: classic:
sbe: "code" : 5075301, "errmsg" : "Executor error during find command :: caused by :: $indexOfCP substring must resolve to a string"