Hi, I am new to Retool and I have been using MongoDB as my DB.
I want to know how can I add new ObjectIds using "insertMany" action type. Let me give you a complete background of what I wish to achieve.
I am trying to create an application for Promos & Discounts. The purpose of this application is to add / update / delete a promo. Promos itself is a separate collection that contains all the information related to promos. I am attaching an image for better understanding.
As you can see, it has multiple fields. What I am more interested in is the Courses field. So the courses field is an array of ObjectIds. Each ObjectId refers to an _id in my courses collection (attaching an image).
Now, I want to create a new promo or update the existing one. Everything is working fine but when I try using the multi-select to choose multiple courses, it is being registered as a string in my database.
I have also tried using the MongoDB extended JSON syntax but it doesn't work. If I try to put in a single ObjectId it works but for an array it doesn't work.
This is for the single ObjectId:
I would really appreciate your response. I am new to this so I am struggling with the code.