I have just upgraded to the newset appsmith, from being many months (8 maybe?) out of date. I am using MongoDB and updated that as well. I have since found what I think is a bug. I have the following MongoDB Find query called “get_student_active_course” that worked before the update:
{
$and: [
{end_date:{$gte:ISODate({{moment().format()}})}},
{start_date:{$lte:ISODate({{moment().format()}})}},
{ _id : { $in : [{{this.params.paramies}}] } }
]
}
I am passing the following, which works great if I manually replace it in the query, as the “paramies”:
ObjectId('6316507d58f017caa9bbc2a8'),ObjectId('64063a282e3e538330237284')
via this code(it’s stripped down, but emulates the final code output):
const new_array = [];
for await (const [key, value] of Object.entries(obj)) {
new_array.push(`ObjectId('${value}')`);
}
var stringArray = await new_array.toString();
return await get_student_active_course.run({paramies:stringArray })
I know some code is cut out, but the value I posted above for “paramies” is what stringArray is outputting. Before the update, I did not have {{this.params.paramies}}
inside an array and was passing
[ ObjectId('6316507d58f017caa9bbc2a8'),ObjectId('64063a282e3e538330237284')]
which was working, then after the update it was throwingan error saying the query need the array.
Any advice on what I might be doing wrong? Or is this a bug?